ClientSettings

scamper.http.client.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

Key Value
accept */*
acceptEncodings Nil
bufferSize 8192
readTimeout 30000
continueTimeout 1000
keepAlive false
coookies CookieStore.Null
resolveTo (Not set)
trust (Not set)
incoming (Not set)
outgoing (Not set)

Attributes

Constructor

Creates client settings.

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def accept(ranges: Seq[MediaRange]): ClientSettings.this.type

Sets accepted content types.

Sets accepted content types.

The Accept header for each outgoing request is set accordingly.

Attributes

def accept(one: MediaRange, more: MediaRange*): ClientSettings.this.type

Sets accepted content types.

Sets accepted content types.

The Accept header for each outgoing request is set accordingly.

Attributes

def acceptEncoding(ranges: Seq[ContentCodingRange]): ClientSettings.this.type

Sets accepted content encodings.

Sets accepted content encodings.

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

Attributes

Sets accepted content encodings.

Sets accepted content encodings.

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

Attributes

def bufferSize(size: Int): ClientSettings.this.type

Sets buffer size.

Sets buffer size.

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

Attributes

def continueTimeout(timeout: Int): ClientSettings.this.type

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.

Attributes

Note

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

def cookies(cookieStore: CookieStore): ClientSettings.this.type

Sets cookie store.

Sets cookie store.

Value parameters

cookies

cookie store

Attributes

def incoming(filter: ResponseFilter): ClientSettings.this.type

Adds supplied response filter.

Adds supplied response filter.

Attributes

def keepAlive(enable: Boolean): ClientSettings.this.type

Enables or disables persistent connections.

Enables or disables persistent connections.

Attributes

def outgoing(filter: RequestFilter): ClientSettings.this.type

Adds supplied request filter.

Adds supplied request filter.

Attributes

def readTimeout(timeout: Int): ClientSettings.this.type

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.

Attributes

def reset(): ClientSettings.this.type

Resets to default settings.

Resets to default settings.

Attributes

def resolveTo(authority: String, secure: Boolean): ClientSettings.this.type

Sets authority to which relative targets are resolved.

Sets authority to which relative targets are resolved.

Value parameters

secure

use https and wss schemes

Attributes

def resolveTo(host: String, port: Int, secure: Boolean): ClientSettings.this.type

Sets host and port to which relative targets are resolved.

Sets host and port to which relative targets are resolved.

Value parameters

secure

use https and wss schemes

Attributes

def resolveTo(host: String, port: Option[Int], secure: Boolean): ClientSettings.this.type

Sets host and port to which relative targets are resolved.

Sets host and port to which relative targets are resolved.

Value parameters

secure

use https and wss schemes

Attributes

Creates client using current settings.

Creates client using current settings.

Attributes

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

Sets truststore.

Sets truststore.

Value parameters

password

store password

storeType

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

truststore

truststore used for HTTPS connections

Attributes

def trust(manager: TrustManager): ClientSettings.this.type

Sets trust manager.

Sets trust manager.

Value parameters

manager

trust manager used for HTTPS connections

Attributes