ktor-client-core / io.ktor.client / HttpClient

HttpClient

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

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

The HttpClientEngine is selected from the dependencies. https://ktor.io/clients/http-client/engines.html

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.