Package io.ktor.client.call

Types

Link copied to clipboard
class DoubleReceiveException(call: HttpClientCall) : IllegalStateException

Exception representing that the response payload has already been received.

Link copied to clipboard
open class HttpClientCall : CoroutineScope

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

Link copied to clipboard
data class HttpEngineCall(request: HttpRequest, response: HttpResponse)

Raw http call produced by engine.

Link copied to clipboard
class NoTransformationFoundException(response: HttpResponse, from: KClass<*>, to: KClass<*>) : UnsupportedOperationException

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

Link copied to clipboard
class ReceivePipelineException constructor(request: HttpClientCall, info: TypeInfo, cause: Throwable) : IllegalStateException

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

Link copied to clipboard
typealias Type = io.ktor.util.reflect.Type

Information about type.

Link copied to clipboard
data class TypeInfo(type: KClass<*>, reifiedType: Type, kotlinType: KType?) : TypeInfo

Ktor type information.

Link copied to clipboard
class UnsupportedContentTypeException(content: OutgoingContent) : IllegalStateException
Link copied to clipboard
class UnsupportedUpgradeProtocolException(url: Url) : IllegalArgumentException

Functions

Link copied to clipboard
suspend fun HttpClient.call(builder: HttpRequestBuilder): HttpClientCall

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

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(url: Url, block: suspend HttpRequestBuilder.() -> Unit = {}): HttpClientCall

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

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

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

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.

Link copied to clipboard
inline suspend fun <T> HttpClientCall.receive(): T

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

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

Tries to receive the payload of the response as a specific type T described in typeInfo.

Link copied to clipboard
suspend fun HttpClientCall.save(): HttpClientCall

Fetch data for HttpClientCall and close the origin.

Link copied to clipboard
inline fun <T> typeInfo(): TypeInfo

Returns TypeInfo for the specified type T