OkHttpConfig

class OkHttpConfig : HttpClientEngineConfig

A configuration for the OkHttp client engine.

Constructors

Link copied to clipboard
fun OkHttpConfig()

Functions

Link copied to clipboard
fun addInterceptor(interceptor: Interceptor)

Adds an Interceptor to the OkHttp client.

Link copied to clipboard
fun addNetworkInterceptor(interceptor: Interceptor)

Adds a network Interceptor to the OkHttp client.

Link copied to clipboard
fun config(block: OkHttpClient.Builder.() -> Unit)

Configures OkHttpClient using OkHttpClient.Builder.

Properties

Link copied to clipboard
var clientCacheSize: Int = 10

Specifies the size of cache that keeps recently used OkHttpClient instances. Set this property to 0 to disable caching.

Link copied to clipboard
var pipelining: Boolean
Link copied to clipboard
var preconfigured: OkHttpClient? = null

Allows you to specify a preconfigured OkHttpClient instance.

Link copied to clipboard
var proxy: ProxyConfig?
Link copied to clipboard
var threadsCount: Int
Link copied to clipboard
var webSocketFactory: WebSocket.Factory? = null

Specifies the WebSocket.Factory used to create a WebSocket instance. Otherwise, OkHttpClient is used directly.