ktor-client-core / io.ktor.client.call

Package io.ktor.client.call

Types

HttpClientCall

open class HttpClientCall : CoroutineScope

A class that represents a single pair of request and response for a specific HttpClient.

HttpEngineCall

data class HttpEngineCall

Raw http call produced by engine.

Type

expect interface Type

Information about type.

TypeInfo

data class TypeInfo

Ktor type information.

Exceptions

DoubleReceiveException

class DoubleReceiveException : IllegalStateException

Exception representing that the response payload has already been received.

NoTransformationFoundException

class NoTransformationFoundException : UnsupportedOperationException

Exception representing the no transformation was found. It includes the received type and the expected type as part of the message.

ReceivePipelineException

class ReceivePipelineException : IllegalStateException

Exception representing fail of the response pipeline cause contains origin pipeline exception

UnsupportedContentTypeException

class UnsupportedContentTypeException : IllegalStateException

UnsupportedUpgradeProtocolException

class UnsupportedUpgradeProtocolException : IllegalArgumentException

Functions

call

suspend fun HttpClient.call(block: suspend HttpRequestBuilder.() -> Unit = {}): HttpClientCall

Constructs a HttpClientCall from this HttpClient and with the specified HttpRequestBuilder configured inside the block.

suspend fun HttpClient.call(builder: HttpRequestBuilder): HttpClientCall

Constructs a HttpClientCall from this HttpClient and with the specified HTTP request builder.

suspend fun HttpClient.call(urlString: String, block: suspend HttpRequestBuilder.() -> Unit = {}): HttpClientCall
suspend fun HttpClient.call(url: Url, block: suspend HttpRequestBuilder.() -> Unit = {}): HttpClientCall
suspend fun HttpClient.call(url: URL, block: HttpRequestBuilder.() -> Unit = {}): HttpClientCall

Constructs a HttpClientCall from this HttpClient, an url and an optional block configuring a HttpRequestBuilder.

receive

suspend fun <T> HttpClientCall.receive(): T
suspend fun <T> HttpResponse.receive(): T

Tries to receive the payload of the response as an specific type T.

save

suspend fun HttpClientCall.save(): HttpClientCall

Fetch data for HttpClientCall and close the origin.

typeInfo

expect fun <T> typeInfo(): TypeInfo

Returns TypeInfo for the specified type T