Package io.ktor.client.engine

Types

Link copied to clipboard
class ClientEngineClosedException(cause: Throwable?) : IllegalStateException

Exception that indicates that client engine is already closed.

Link copied to clipboard
object engines : Iterable<T>

Shared engines collection for. Use append to enable engine auto discover in HttpClient().

Link copied to clipboard
interface HttpClientEngine : CoroutineScope, Closeable

Base interface use to define engines for HttpClient.

Link copied to clipboard
abstract class HttpClientEngineBase(engineName: String) : HttpClientEngine

Abstract implementation of HttpClientEngine responsible for lifecycle control of dispatcher and coroutineContext as well as proper call context management. Should be considered as the best parent class for custom HttpClientEngine implementations.

Link copied to clipboard
interface HttpClientEngineCapability<T>

Capability required by request to be supported by HttpClientEngine with T representing type of the capability configuration.

Link copied to clipboard
open class HttpClientEngineConfig

Base configuration for HttpClientEngine.

Link copied to clipboard
interface HttpClientEngineFactory<out T : HttpClientEngineConfig>

Factory of HttpClientEngine with a specific T of HttpClientEngineConfig.

Link copied to clipboard
abstract class HttpClientJvmEngine(engineName: String) : HttpClientEngine

Base jvm implementation for HttpClientEngine

Link copied to clipboard
expect object ProxyBuilder

ProxyConfig factory.

actual object ProxyBuilder

ProxyConfig factory.

actual object ProxyBuilder

ProxyConfig factory.

Link copied to clipboard
expect class ProxyConfig

Proxy configuration.

actual typealias ProxyConfig = Proxy
actual class ProxyConfig(url: Url)

Proxy configuration.

Link copied to clipboard
enum ProxyType : Enum<ProxyType>

Types of proxy

Functions

Link copied to clipboard
suspend fun callContext(): CoroutineContext

Returns current call context if exists, otherwise null.

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

Link copied to clipboard
fun ProxyBuilder.http(urlString: String): ProxyConfig

Create http proxy from urlString.

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

Merge headers from content and requestHeaders according to OutgoingContent properties

Link copied to clipboard
expect fun ProxyConfig.resolveAddress(): NetworkAddress

Resolve remote address of ProxyConfig.

actual fun ProxyConfig.resolveAddress(): NetworkAddress

Resolve remote address of ProxyConfig.

Properties

Link copied to clipboard
val DEFAULT_CAPABILITIES: Set<HttpTimeout.Feature>

Default capabilities expected to be supported by engine.

Link copied to clipboard
val KTOR_DEFAULT_USER_AGENT: String

Default user agent to use in ktor client.

Link copied to clipboard
expect val ProxyConfig.type: ProxyType

Type of configured proxy.

actual val ProxyConfig.type: ProxyType

Type of configured proxy.