Package-level declarations

Types

Link copied to clipboard
sealed interface HttpResponse

Immutable container for an HTTP response

Link copied to clipboard

Used to construct an HTTP response

Functions

Link copied to clipboard
suspend fun dumpResponse(response: HttpResponse, dumpBody: Boolean): <Error class: unknown class><HttpResponse, String>

Dump a debug description of the response. Either the original response or a copy will be returned to the caller depending on if the body is consumed.

Link copied to clipboard
fun HttpResponse(status: HttpStatusCode, headers: Headers = Headers.Empty, body: HttpBody = HttpBody.Empty): HttpResponse

Use the default HTTP response implementation

Inherited functions

Link copied to clipboard
fun HttpResponse.copy(status: HttpStatusCode = this.status, headers: Headers = this.headers, body: HttpBody = this.body): HttpResponse

Replace the response body

Link copied to clipboard
fun <Error class: unknown class>.getAllHeaders(name: String): List<String>?

Get all HTTP header values associated with the given name.

Link copied to clipboard
fun <Error class: unknown class>.header(name: String): String?

Get an HTTP header value by name. Returns the first header if multiple headers are set

Link copied to clipboard

Create a read-only view of a builder. Often, we need a read-only view of a builder that may get modified. This would normally require a round trip invoking HttpResponseBuilder.build and then converting that back to a builder using HttpResponse.toBuilder. Instead, we can create an immutable view of a builder that is cheap to convert to a builder.

Link copied to clipboard
fun <Error class: unknown class>.statusCode(): HttpStatusCode?

Get the HTTP status code of the response

Link copied to clipboard