class HttpClientConfig<T : HttpClientEngineConfig>
Mutable configuration used by HttpClient.
HttpClientConfig()
Mutable configuration used by HttpClient. |
var developmentMode: Boolean
Indicate if client should use development mode. In development mode client pipelines have advanced stack traces. |
|
var expectSuccess: Boolean
Terminate HttpClient.receivePipeline if status code is not success(>=300). |
|
var followRedirects: Boolean
Use HttpRedirect feature to automatically follow redirects. |
|
var useDefaultTransformers: Boolean
Use defaultTransformers to automatically handle simple ContentType. |
fun clone(): HttpClientConfig<T>
Clones this HttpClientConfig duplicating all the features and customInterceptors. |
|
fun engine(block: T.() -> Unit): Unit
Configure engine parameters. |
|
fun <TBuilder : Any, TFeature : Any> install(feature: HttpClientFeature<TBuilder, TFeature>, configure: TBuilder.() -> Unit = {}): Unit
Installs a specific feature and optionally configure it. fun install(key: String, block: HttpClient.() -> Unit): Unit
Installs an interceptor defined by block. The key parameter is used as a unique name, that also prevents installing duplicated interceptors. fun install(client: HttpClient): Unit
Applies all the installed features and customInterceptors from this configuration into the specified client. |
|
operator fun plusAssign(other: HttpClientConfig<out T>): Unit
Install features from other client config. |
fun HttpClientConfig<*>.BrowserUserAgent(): Unit
Install UserAgent feature with browser-like user agent. |
|
fun HttpClientConfig<*>.Charsets(block: Config.() -> Unit): Unit
Configure client charsets. |
|
fun HttpClientConfig<*>.CurlUserAgent(): Unit
Install UserAgent feature with browser-like user agent. |
|
fun HttpClientConfig<*>.HttpResponseValidator(block: Config.() -> Unit): Unit
Install HttpCallValidator with block configuration. |
|
fun HttpClientConfig<*>.ResponseObserver(block: ResponseHandler): Unit
Install ResponseObserver feature in client. |
|
fun HttpClientConfig<*>.WebSockets(config: Config.() -> Unit): Unit
Install WebSockets feature using the config as configuration. |
|
fun HttpClientConfig<*>.addDefaultResponseValidation(): Unit
Default response validation. Check the response status code in range (0..299). |
|
fun HttpClientConfig<*>.defaultRequest(block: HttpRequestBuilder.() -> Unit): Unit
Set request default parameters. |