HttpRequestBuilder

Used to construct an HTTP request

Parameters

method

The HTTP method (verb) to use when making the request

url

Endpoint to make request to

headers

HTTP headers

body

Outgoing payload. Initially empty

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: <Error class: unknown class>

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Inherited functions

Link copied to clipboard

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

Link copied to clipboard

Modify the headers inside the given block

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 HttpRequestBuilder.url(value: <Error class: unknown class>)

Set values from an existing Url instance

inline fun HttpRequestBuilder.url(block: <Error class: unknown class>.() -> Unit)

Modify the URL inside the block