Package aws.smithy.kotlin.runtime.http.request

Types

Link copied to clipboard
interface HttpRequest

Immutable representation of an HTTP request

Link copied to clipboard
class HttpRequestBuilder : CanDeepCopy<HttpRequestBuilder>

Used to construct an HTTP request

Functions

Link copied to clipboard
suspend fun dumpRequest(request: HttpRequestBuilder, dumpBody: Boolean): String

Dump a debug description of the request

Link copied to clipboard
fun HttpRequestBuilder.header(name: String, value: String)

Add a single header. This will append to any existing headers with the same name.

Link copied to clipboard
fun HttpRequestBuilder.headers(block: HeadersBuilder.() -> Unit)

Modify the headers inside the given block

Link copied to clipboard
fun HttpRequest(    method: HttpMethod,     url: Url,     headers: Headers,     body: HttpBody,     trailingHeaders: DeferredHeaders = DeferredHeaders.Empty): HttpRequest

Create a new HttpRequest

Link copied to clipboard
fun HttpRequestBuilder.immutableView(allowToBuilder: Boolean = false): HttpRequest

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 HttpRequestBuilder.build and then converting that back to a builder using HttpRequest.toBuilder. Instead, we can create an immutable view of a builder that is cheap to convert to a builder.

Link copied to clipboard
fun HttpRequest.toBuilder(): HttpRequestBuilder

Convert an HttpRequest back to an HttpRequestBuilder

Link copied to clipboard
fun HttpRequestBuilder.url(value: Url)

Set values from an existing Url instance

fun HttpRequestBuilder.url(block: UrlBuilder.() -> Unit)

Modify the URL inside the block