object DataConversion : HttpClientFeature<Configuration, DataConversion>
Object for installing io.ktor.util.converters.DataConversion as feature |
|
class DefaultRequest
Feature is used to set request default parameters. |
|
class |
|
class HttpCallValidator
Response validator feature is used for validate response and handle response exceptions. |
|
interface HttpClientFeature<out TConfig : Any, TFeature : Any>
Base interface representing a HttpClient feature. |
|
class HttpPlainText
HttpClient feature that encodes String request bodies to TextContent and processes the response body as String. |
|
class HttpRedirect
HttpClient feature that handles http redirect |
|
class HttpRequestTimeoutException
This exception is thrown in case request timeout exceeded. |
|
class HttpSend
This is internal feature that is always installed. |
|
class HttpTimeout
Client HTTP timeout feature. There are no default values, so default timeouts will be taken from engine configuration or considered as infinite time if engine doesn't provide them. |
|
interface Sender
This interface represents a request send pipeline interceptor chain |
|
class UserAgent
Default user-agent feature for HttpClient. |
class ClientRequestException : ResponseException
Bad client request exception. |
|
class RedirectResponseException : ResponseException
Unhandled redirect exception. |
|
open class ResponseException : IllegalStateException
Base for default response exceptions. |
|
class SendCountExceedException : IllegalStateException
Thrown when too many actual requests were sent during a client call. It could be caused by infinite or too long redirect sequence. Maximum number of requests is limited by HttpSend.maxSendCount |
|
class ServerResponseException : ResponseException
Server error exception. |
typealias |
|
typealias CallExceptionHandler = suspend (cause: Throwable) -> Unit
Response exception handler method. |
|
typealias HttpSendInterceptor = suspend Sender.(HttpClientCall, HttpRequestBuilder) -> HttpClientCall
HttpSend pipeline interceptor function |
|
typealias HttpSendInterceptorBackwardCompatible = suspend Sender.(HttpClientCall) -> HttpClientCall
HttpSend pipeline interceptor function backward compatible with previous implementation. |
|
typealias ResponseValidator = suspend (response: HttpResponse) -> Unit
Response validator method. |
var HttpRequestBuilder.expectSuccess: Boolean
Terminate HttpClient.receivePipeline if status code is not successful (>=300). |
fun HttpClientConfig<*>.BrowserUserAgent(): Unit
Install UserAgent feature with browser-like user agent. |
|
fun HttpClientConfig<*>.Charsets(block: Config.() -> Unit): Unit
Configure client charsets. |
|
fun ConnectTimeoutException(request: HttpRequestData, cause: Throwable? = null): ConnectTimeoutException fun ConnectTimeoutException(url: String, timeout: Long?, cause: Throwable? = null): ConnectTimeoutException
This exception is thrown in case connect timeout exceeded. |
|
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 SocketTimeoutException(request: HttpRequestData, cause: Throwable? = null): SocketTimeoutException
This exception is thrown in case socket timeout (read or write) exceeded. |
|
fun HttpClientConfig<*>.addDefaultResponseValidation(): Unit
Default response validation. Check the response status code in range (0..299). |
|
fun convertLongTimeoutToIntWithInfiniteAsZero(timeout: Long): Int
Convert long timeout in milliseconds to int value. To do that we need to consider HttpTimeout.INFINITE_TIMEOUT_MS as zero and convert timeout value to Int. |
|
fun convertLongTimeoutToLongWithInfiniteAsZero(timeout: Long): Long
Convert long timeout in milliseconds to long value. To do that we need to consider HttpTimeout.INFINITE_TIMEOUT_MS as zero and convert timeout value to Int. |
|
fun HttpClientConfig<*>.defaultRequest(block: HttpRequestBuilder.() -> Unit): Unit
Set request default parameters. |
|
fun HttpClient.defaultTransformers(): Unit
Install default transformers. Usually installed by default so there is no need to use it unless you have disabled it via HttpClientConfig.useDefaultTransformers. |
|
fun <B : Any, F : Any> HttpClient.feature(feature: HttpClientFeature<B, F>): F?
Try to get the feature installed in this client. Returns |
|
operator fun <B : Any, F : Any> HttpClient.get(feature: HttpClientFeature<B, F>): F
Find the feature installed in HttpClient. |
|
fun HttpRequestBuilder.timeout(block: HttpTimeoutCapabilityConfiguration.() -> Unit): Unit
Adds timeout boundaries to the request. Requires HttpTimeout feature to be installed. |