HttpClient

The Client that is responsible for constructing a Call based on a Request and return an appropriate Response

Types

Link copied to clipboard
interface Builder

A convenience builder for constructing HttpClient object.

Properties

Link copied to clipboard
abstract val callTimeoutMillis: Int

Default call timeout (in milliseconds). By default there is no timeout for complete calls, but there is for the connect, write, and read actions within a call.

Link copied to clipboard

Default connect timeout (in milliseconds)

Link copied to clipboard
abstract val readTimeoutMillis: Int

Default read timeout (in milliseconds).

Link copied to clipboard
abstract val writeTimeoutMillis: Int

Default write timeout (in milliseconds).

Functions

Link copied to clipboard
abstract fun <ReqBody : Any, ResBody : Any> callWith(requestSerializationType: Type, responseDeSerializationType: Type, build: Request.Builder<ReqBody>.() -> Unit): Call<ReqBody, ResBody>
abstract fun <ReqBody : Any, ResBody : Any> callWith(requestSerializationClass: KClass<ReqBody>, responseDeSerializationClass: KClass<ResBody>, build: Request.Builder<ReqBody>.() -> Unit): Call<ReqBody, ResBody>

Constructs a call with the passed Request Builder instance.

abstract fun <ReqBody : Any, ResBody : Any> callWith(requestSerializationClass: KClass<ReqBody>, responseDeSerializationClass: KClass<ResBody>, request: Request<ReqBody>): Call<ReqBody, ResBody>

Constructs a call with the passed Request instance.

Link copied to clipboard
inline fun <ReqBody : Any, ResBody : Any> Call.Factory.callWith(noinline builder: Request.Builder<ReqBody>.() -> Unit): Call<ReqBody, ResBody>

Constructs a call with the passed Request Builder instance. The Request and Response Types are passed as reified Generic Parameters.

Link copied to clipboard

Builds a new HttpClient with custom configuration but same underlying Resources.