ClientSettings

Defines HTTP client settings.

ClientSettings is a mutable structure. With each applied change, the settings are modified and returned. After applying the desired settings, a client is created using a factory method.

Default Settings

KeyValue
accept*/*
acceptEncodingsNil
bufferSize8192
readTimeout30000
continueTimeout1000
keepAlivefalse
coookiesCookieStore.Null
trust(Not set)
incoming(Not set)
outgoing(Not set)
Constructor

Creates client settings.

class Object
trait Matchable
class Any

Value members

Concrete methods

def accept(ranges: Seq[MediaRange]): ClientSettings

Sets accepted content types.

Sets accepted content types.

The Accept header for each outgoing request is set accordingly.

Sets accepted content types.

Sets accepted content types.

The Accept header for each outgoing request is set accordingly.

Sets accepted content encodings.

Sets accepted content encodings.

The Accept-Encoding header for each outgoing request is set accordingly.

Sets accepted content encodings.

Sets accepted content encodings.

The Accept-Encoding header for each outgoing request is set accordingly.

def bufferSize(size: Int): ClientSettings

Sets buffer size.

Sets buffer size.

The buffer size specifies the size in bytes of client socket's send and receive buffers.

def continueTimeout(timeout: Int): ClientSettings

Sets continue timeout.

Sets continue timeout.

The continue timeout specifies how many milliseconds to wait for a 100 (Continue) response before sending the request body.

Note

This applies only to requests that include an Except header set to 100-Continue.

Sets cookie store.

Sets cookie store.

Value Params
cookies

cookie store

Creates client using current settings.

Creates client using current settings.

Adds supplied response filter.

Adds supplied response filter.

def keepAlive(enable: Boolean): ClientSettings

Enables or disables persistent connections.

Enables or disables persistent connections.

Adds supplied request filter.

Adds supplied request filter.

def readTimeout(timeout: Int): ClientSettings

Sets read timeout.

Sets read timeout.

The read timeout specifies how many milliseconds a read from client socket blocks before it times out, whereafter SocketTimeoutException is thrown.

Resets to default settings.

Resets to default settings.

def trust(truststore: File, storeType: String, password: Option[String]): ClientSettings

Sets truststore.

Sets truststore.

Value Params
password

store password

storeType

store type (e.g., JKS or PKCS12)

truststore

truststore used for HTTPS connections

def trust(manager: TrustManager): ClientSettings

Sets trust manager.

Sets trust manager.

Value Params
manager

trust manager used for HTTPS connections