OkHttpConfig

class OkHttpConfig : HttpClientEngineConfig

Configuration for OkHttp client engine.

Constructors

<init>

OkHttpConfig()

Configuration for OkHttp client engine.

Properties

clientCacheSize

var clientCacheSize: Int

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

preconfigured

var preconfigured: OkHttpClient?

Preconfigured OkHttpClient instance instead of configuring one.

Inherited Properties

pipelining

var pipelining: Boolean

Enable http pipelining advice.

proxy

var proxy: ProxyConfig?

Proxy address to use. Use system proxy by default.

response

val response: Nothing

threadsCount

var threadsCount: Int

Network threads count advice.

Functions

addInterceptor

fun addInterceptor(interceptor: Interceptor): Unit

Add Interceptor to OkHttp client.

addNetworkInterceptor

fun addNetworkInterceptor(interceptor: Interceptor): Unit

Add network Interceptor to OkHttp client.

config

fun config(block: Builder.() -> Unit): Unit

Configure OkHttpClient using OkHttpClient.Builder.