Package io.ktor.client

Types

Link copied to clipboard
class HttpClient(engine: HttpClientEngine, userConfig: HttpClientConfig<out HttpClientEngineConfig>) : CoroutineScope, Closeable

Asynchronous client to perform HTTP requests.

Link copied to clipboard
class HttpClientConfig<T : HttpClientEngineConfig>

Mutable configuration used by HttpClient.

Link copied to clipboard
annotation class HttpClientDsl

Dsl marker for HttpClient dsl.

Link copied to clipboard
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

Functions

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

Constructs an asynchronous HttpClient using 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.

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.

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

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

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

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

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

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