OkHttpConfig

A configuration for the OkHttp client engine.

Report a problem

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

Specifies if duplex streaming is enabled for the OkHttpClient. Setting this to true allows clients to send and receive data simultaneously using bidirectional streaming (HTTP/2 only).

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.