Package io.ktor.client.engine

Types

HttpClientEngine

interface HttpClientEngine : CoroutineScope, Closeable

Base interface use to define engines for HttpClient.

HttpClientEngineConfig

open class HttpClientEngineConfig

Base configuration for HttpClientEngine.

HttpClientEngineFactory

interface HttpClientEngineFactory<out T : HttpClientEngineConfig>

Factory of HttpClientEngine with a specific T of HttpClientEngineConfig.

HttpClientJvmEngine

abstract class HttpClientJvmEngine : HttpClientEngine

Base jvm implementation for HttpClientEngine

Properties

KTOR_DEFAULT_USER_AGENT

val KTOR_DEFAULT_USER_AGENT: String

Default user agent to use in ktor client.

Functions

config

fun <T : HttpClientEngineConfig> HttpClientEngineFactory<T>.config(
    nested: T.() -> Unit
): HttpClientEngineFactory<T>

Creates a new HttpClientEngineFactory based on this one with further configurations from the nested block.

mergeHeaders

fun mergeHeaders(
    requestHeaders: Headers,
    content: OutgoingContent,
    block: (key: String, value: String) -> Unit
): Unit

Merge headers from content and requestHeaders according to OutgoingContent properties