OkHttpConfig

class OkHttpConfig : HttpClientEngineConfig

Configuration for OkHttp client engine.

Constructors

Link copied to clipboard
fun OkHttpConfig()

Functions

Link copied to clipboard
fun addInterceptor(interceptor: Interceptor)

Add Interceptor to OkHttp client.

Link copied to clipboard
fun addNetworkInterceptor(interceptor: Interceptor)

Add network Interceptor to OkHttp client.

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

Configure OkHttpClient using OkHttpClient.Builder.

Properties

Link copied to clipboard
var clientCacheSize: Int = 10

Size of the cache that keeps least recently used OkHttpClient instances. Set "0" to avoid caching.

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

Preconfigured OkHttpClient instance instead of configuring one.

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

If provided, this WebSocket.Factory will be used to create WebSocket instances. Otherwise, OkHttpClient is used directly.