OkHttpConfig

A configuration for the OkHttp client engine.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
var preconfigured: OkHttpClient?

Allows you to specify a preconfigured OkHttpClient instance.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var webSocketFactory: WebSocket.Factory?

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

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.