HttpRequestBuilder
class HttpRequestBuilder : HttpMessageBuilder
Class for building HttpRequestData.
Constructors
HttpRequestBuilder() Class for building HttpRequestData. |
Properties
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. |
Functions
fun build(): HttpRequestData Create immutable HttpRequestData |
|
fun <T : Any> getCapabilityOrNull( Retrieve capability by key. |
|
fun setAttributes(block: Attributes.() -> Unit): Unit Set request specific attributes specified by block. |
|
fun <T : Any> setCapability( 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( 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. |
Extension Properties
var HttpRequestBuilder.expectSuccess: Boolean |
|
var HttpRequestBuilder.host: String Gets the associated URL’s host. |
|
var HttpRequestBuilder.port: Int Gets the associated URL’s port. |
Extension Functions
fun HttpRequestBuilder.accept(contentType: ContentType): Unit Sets the |
|
fun HttpMessageBuilder. fun HttpMessageBuilder.charset(): Charset? Parse charset from |
|
fun HttpMessageBuilder. fun HttpMessageBuilder.contentLength(): Long? Parse |
|
fun HttpMessageBuilder.contentType(type: ContentType): Unit Set fun HttpMessageBuilder.contentType(): ContentType? Parse |
|
fun HttpRequestBuilder.cookie( Sets a single header of key with a specific value if the value is not null. |
|
fun HttpMessageBuilder.cookies(): List<Cookie> Parse |
|
fun HttpMessageBuilder.etag(): String? Parse |
|
fun HttpMessageBuilder.expires(): Date? Parse |
|
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( Executes a block that configures the HeadersBuilder associated to this request. |
|
fun HttpMessageBuilder.ifModifiedSince(date: Date): Unit Set |
|
fun HttpMessageBuilder.ifNoneMatch(value: String): Unit Set |
|
fun HttpMessageBuilder.lastModified(): Date? Parse |
|
fun HttpMessageBuilder.maxAge(seconds: Int): Unit Append |
|
fun HttpRequestBuilder.parameter( 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( Mutates this copying all the data from another request using it as base. fun HttpRequestBuilder.takeFrom( Sets the HttpRequestBuilder from request. |
|
fun HttpRequestBuilder.timeout( Adds timeout boundaries to the request. Requires HttpTimeout feature to be installed. |
|
fun HttpRequestBuilder.url( Executes a block that configures the URLBuilder associated to this request. fun HttpRequestBuilder.url( 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. |
|
fun HttpMessageBuilder.userAgent(content: String): Unit Set |
|
fun HttpMessageBuilder.vary(): List<String>? Parse |
Companion Object Extension Functions
operator fun HttpRequestBuilder.Companion.invoke( Executes a block that configures the URLBuilder associated to thisrequest. operator fun HttpRequestBuilder.Companion.invoke( Constructs a HttpRequestBuilder from URL information: scheme, host, port and path and optionally further configures it using block. operator fun HttpRequestBuilder.Companion.invoke( Constructs a HttpRequestBuilder from url. |