class HttpRequestBuilder : HttpMessageBuilder
Class for building HttpRequestData.
HttpRequestBuilder()
Class for building HttpRequestData. |
val attributes: Attributes
Call specific attributes. |
|
var body: Any
The body for this request. Initially EmptyContent. |
|
var executionContext: Job
A deferred used to control the execution of this request. |
|
val headers: HeadersBuilder
HeadersBuilder to configure the headers for this request. |
|
var method: HttpMethod
HttpMethod used by this request. HttpMethod.Get by default. |
|
val url: URLBuilder
URLBuilder to configure the URL for this request. |
fun build(): HttpRequestData
Create immutable HttpRequestData |
|
fun <T : Any> getCapabilityOrNull(key: HttpClientEngineCapability<T>): T?
Retrieve capability by key. |
|
fun setAttributes(block: Attributes.() -> Unit): Unit
Set request specific attributes specified by block. |
|
fun <T : Any> setCapability(key: HttpClientEngineCapability<T>, capability: T): Unit
Set capability configuration. |
|
fun takeFrom(builder: HttpRequestBuilder): HttpRequestBuilder
Mutates this copying all the data but execution context from another builder using it as base. |
|
fun takeFromWithExecutionContext(builder: HttpRequestBuilder): HttpRequestBuilder
Mutates this copying all the data from another builder using it as base. |
|
fun url(block: URLBuilder.(URLBuilder) -> Unit): Unit
Executes a block that configures the URLBuilder associated to this request. |
var HttpRequestBuilder.expectSuccess: Boolean |
|
var HttpRequestBuilder.host: String
Gets the associated URL's host. |
|
var HttpRequestBuilder.port: Int
Gets the associated URL's port. |
fun HttpRequestBuilder.accept(contentType: ContentType): Unit
Sets the |
|
fun HttpRequestBuilder.cookie(name: String, value: String, maxAge: Int = 0, expires: GMTDate? = null, domain: String? = null, path: String? = null, secure: Boolean = false, httpOnly: Boolean = false, extensions: Map<String, String?> = emptyMap()): Unit
Sets a single header of key with a specific value if the value is not null. |
|
fun HttpRequestBuilder.header(key: String, value: Any?): Unit
Sets a single header of key with a specific value if the value is not null. |
|
fun HttpRequestBuilder.headers(block: HeadersBuilder.() -> Unit): HeadersBuilder
Executes a block that configures the HeadersBuilder associated to this request. |
|
fun HttpRequestBuilder.parameter(key: String, value: Any?): Unit
Sets a single URL query parameter of key with a specific value if the value is not null. Can not be used to set form parameters in the body. |
|
fun HttpRequestBuilder.takeFrom(request: HttpRequest): HttpRequestBuilder
Mutates this copying all the data from another request using it as base. fun HttpRequestBuilder.takeFrom(request: HttpRequestData): HttpRequestBuilder
Sets the HttpRequestBuilder from request. |
|
fun HttpRequestBuilder.timeout(block: HttpTimeoutCapabilityConfiguration.() -> Unit): Unit
Adds timeout boundaries to the request. Requires HttpTimeout feature to be installed. |
|
fun HttpRequestBuilder.url(block: URLBuilder.() -> Unit): Unit
Executes a block that configures the URLBuilder associated to this request. fun HttpRequestBuilder.url(scheme: String = "http", host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", block: URLBuilder.() -> Unit = {}): Unit
Sets the url using the specified scheme, host, port and path. fun HttpRequestBuilder.url(urlString: String): Unit
Sets the HttpRequestBuilder.url from urlString. fun HttpRequestBuilder.url(url: Url): Unit fun HttpRequestBuilder.url(url: URL): URLBuilder
Sets the HttpRequestBuilder.url from url. |
operator fun HttpRequestBuilder.Companion.invoke(block: URLBuilder.() -> Unit): HttpRequestBuilder
Executes a block that configures the URLBuilder associated to thisrequest. operator fun HttpRequestBuilder.Companion.invoke(scheme: String = "http", host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", block: URLBuilder.() -> Unit = {}): HttpRequestBuilder
Constructs a HttpRequestBuilder from URL information: scheme, host, port and path and optionally further configures it using block. operator fun HttpRequestBuilder.Companion.invoke(url: URL): HttpRequestBuilder
Constructs a HttpRequestBuilder from url. |