Package io.ktor.client

Types

HttpClient

class HttpClient : CoroutineScope, Closeable

Asynchronous client to perform HTTP requests.

HttpClientConfig

class HttpClientConfig<T : HttpClientEngineConfig>

Mutable configuration used by HttpClient.

HttpClientEngineContainer

interface HttpClientEngineContainer

A container is searched across dependencies using ServiceLoader to find client implementations. An implementation of this interface provides HTTP client factory and only used to find the default client engine when HttpClient function is called with no particular client implementation specified

Annotations

HttpClientDsl

annotation class HttpClientDsl

Dsl marker for HttpClient dsl.

Functions

HttpClient

expect fun HttpClient(
    block: HttpClientConfig<*>.() -> Unit = {}
): HttpClient

Constructs an asynchronous HttpClient using optional block for configuring this client.

fun <T : HttpClientEngineConfig> HttpClient(
    engineFactory: HttpClientEngineFactory<T>,
    block: HttpClientConfig<T>.() -> Unit = {}
): HttpClient

Constructs an asynchronous HttpClient using the specified engineFactory and an optional block for configuring this client.

fun HttpClient(
    engine: HttpClientEngine,
    block: HttpClientConfig<*>.() -> Unit
): HttpClient

Constructs an asynchronous HttpClient using the specified engine and a block for configuring this client.