HttpClientConfig
class HttpClientConfig<T : HttpClientEngineConfig>
Mutable configuration used by HttpClient.
Constructors
HttpClientConfig() Mutable configuration used by HttpClient. |
Properties
var expectSuccess: Boolean Terminate HttpClient.responsePipeline 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. |
Functions
fun clone(): HttpClientConfig<T> Clones this HttpClientConfig duplicating all the features and customInterceptors. |
|
Configure engine parameters. |
|
fun <TBuilder : Any, TFeature : Any> install( 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. |
Extension Functions
fun HttpClientConfig<*>.Auth(block: Auth.() -> Unit): Unit Install Auth feature. |
|
fun HttpClientConfig<*>.BrowserUserAgent(): Unit Install UserAgent feature with browser-like user agent. |
|
fun HttpClientConfig<*>.Charsets( Configure client charsets. |
|
fun HttpClientConfig<*>.ContentEncoding( Install or configure ContentEncoding feature. |
|
fun HttpClientConfig<*>.CurlUserAgent(): Unit Install UserAgent feature with browser-like user agent. |
|
fun HttpClientConfig<*>.HttpResponseValidator( Install HttpCallValidator with block configuration. |
|
fun HttpClientConfig<*>.Json(block: Config.() -> Unit): Unit Install JsonFeature. |
|
fun HttpClientConfig<*>.Logging( Configure and install Logging in HttpClient. |
|
fun HttpClientConfig<*>.ResponseObserver( Install ResponseObserver feature in client. |
|
fun HttpClientConfig<*>.addDefaultResponseValidation(): Unit Default response validation. Check the response status code in range (0..299). |
|
fun HttpClientConfig<*>.defaultRequest( Set request default parameters. |