KtorHttpResponse

class KtorHttpResponse(val request: HttpRequest, ktorResponse: HttpResponse) : HttpResponse

Ktor-based HTTP response implementation.

This class implements the HttpResponse interface by wrapping Ktor's HttpResponse. It provides access to the response status, headers, cookies, and body content in a consistent way across the SDK.

The response maintains a reference to the original request for correlation and logging purposes. All response data is lazily accessed from the underlying Ktor response object.

See also

Constructors

Link copied to clipboard
constructor(request: HttpRequest, ktorResponse: HttpResponse)

Properties

Link copied to clipboard
open override val request: HttpRequest

The original HTTP request that generated this response.

Link copied to clipboard
open override val status: Int

Gets the HTTP status code.

Functions

Link copied to clipboard
open suspend override fun body(): String

Gets the response body as a string.

Link copied to clipboard
open override fun cookies(): List<String>

Gets all cookies from the response.

Link copied to clipboard
open override fun header(name: String): String?

Gets a specific header value by name.

Link copied to clipboard
open override fun headers(): Set<Map.Entry<String, List<String>>>

Gets all headers from the response.