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.

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

body

suspend fun <T> HttpClientCall.body(): T
suspend fun <T> HttpResponse.body(): 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.