ktor-client-core / io.ktor.client.request / HttpRequest

HttpRequest

interface HttpRequest : HttpMessage, CoroutineScope

A request for HttpClient, first part of HttpClientCall.

Properties

attributes

abstract val attributes: Attributes

Typed Attributes associated to this call serving as a lightweight container.

call

abstract val call: HttpClientCall

The associated HttpClientCall containing both the underlying HttpClientCall.request and HttpClientCall.response.

content

abstract val content: OutgoingContent

An OutgoingContent representing the request body

coroutineContext

open val coroutineContext: <ERROR CLASS>

method

abstract val method: HttpMethod

The HttpMethod or HTTP VERB used for this request.

url

abstract val url: Url

The Url representing the endpoint and the uri for this request.

Extension Functions

mapEngineExceptions

fun CoroutineScope.mapEngineExceptions(input: ByteReadChannel, request: HttpRequestData): ByteReadChannel

Returns ByteReadChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException.

fun CoroutineScope.mapEngineExceptions(output: ByteWriteChannel, request: HttpRequestData): ByteWriteChannel

Returns ByteWriteChannel with ByteChannel.close handler that returns SocketTimeoutException instead of SocketTimeoutException.

Inheritors

DefaultHttpRequest

open class DefaultHttpRequest : HttpRequest

Default HttpRequest implementation.