ApiRequestBuilder

data class ApiRequestBuilder(    val client: ApiClient,     val httpMethod: HttpMethod,     val host: EndpointHost,     val path: String)

The builder class to construct api request.

Constructors

Link copied to clipboard
fun ApiRequestBuilder(    client: ApiClient,     httpMethod: HttpMethod,     host: EndpointHost,     path: String)

Properties

Link copied to clipboard
var authorizationType: AuthorizationType

Authorization type.

Link copied to clipboard
var body: () -> Any

Request body.

Link copied to clipboard
val client: ApiClient

Current ApiClient.

Link copied to clipboard
val emulationModes: MutableSet<EmulationMode>

Required EmulationMode.

Link copied to clipboard
val forms: ParametersBuilder

Request form parameters.

Link copied to clipboard
val headers: HeadersBuilder

Request headers.

Link copied to clipboard
val host: EndpointHost

Request host.

Link copied to clipboard
val httpMethod: HttpMethod

Request HTTP method.

Link copied to clipboard
var oauthCallbackUrl: String? = null

OAuth callback url ("oauth_callback").

Link copied to clipboard
val parameters: ParametersBuilder

Request url parameters.

Link copied to clipboard
val path: String

Request path.

Extensions

Link copied to clipboard
fun ApiRequestBuilder.formBody(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)

Creates "application/x-www-form-urlencoded" content.

Link copied to clipboard
fun ApiRequestBuilder.header(    key: String,     value: Any?,     mode: EmulationMode? = null)

Sets a header key with value, or update existing one with value.

fun ApiRequestBuilder.header(headers: Headers, mode: EmulationMode? = null)

Adds existing Headers instance to headers.

Link copied to clipboard
fun ApiRequestBuilder.headers(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)

Sets header keys with value, or update existing one with value.

Link copied to clipboard
fun ApiRequestBuilder.jsonBody(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)
fun ApiRequestBuilder.jsonBody(json: JsonObject, mode: EmulationMode? = null)

Creates "application/json" content.

Link copied to clipboard
fun ApiRequestBuilder.multiPartBody(mode: EmulationMode? = null, block: FormBuilder.() -> Unit)

Creates "multipart/form-data" content.

Link copied to clipboard
fun ApiRequestBuilder.parameter(    key: String,     value: Any?,     mode: EmulationMode? = null)

Sets a parameter key with value, or update existing one with value.

Link copied to clipboard
fun ApiRequestBuilder.parameters(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)

Sets parameter keys with value, or update existing one with value.

Link copied to clipboard
val ApiRequestBuilder.session: Session

Shorthand extension to ApiClient.

Link copied to clipboard
val ApiRequestBuilder.url: String

Url string.