Package io.ktor.client.plugins
Types
Plugin that provides observable progress for uploads and downloads
Response exception handler method.
Response exception handler method. request is null if
Bad client request exception.
Object for installing io.ktor.util.converters.DataConversion as plugin
Sets default request parameters. Used to add common headers and URL for a request. Note that trailing slash in base URL and leading slash in request URL are important. The rules to calculate a final URL:
Response validator plugin is used for validate response and handle response exceptions.
Base interface representing a HttpClient plugin.
HttpClient plugin that encodes String request bodies to TextContent and processes the response body as String.
An HttpClient plugin that handles HTTP redirects
A plugin that enables the client to retry failed requests. The default retry policy is 3 retries with exponential delay. Typical usages:
This exception is thrown in case request timeout exceeded.
HttpSend pipeline interceptor function
A client's HTTP timeout plugin. There are no default values, so default timeouts are taken from the engine configuration or considered as infinite time if the engine doesn't provide them.
Unhandled redirect exception.
Base for default response exceptions.
Response validator method.
You could throw an exception to fail the response.
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
Server error exception.
Default user-agent plugin for HttpClient.
Functions
Default response validation. Check the response status code in range (0..299).
Install UserAgent plugin with browser-like user agent.
Configure client charsets.
This exception is thrown in case connect timeout exceeded.
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.
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.
Install UserAgent plugin with browser-like user agent.
Set default request parameters. See DefaultRequest
Install default transformers. Usually installed by default so there is no need to use it unless you have disabled it via HttpClientConfig.useDefaultTransformers.
Install HttpCallValidator with block configuration.
Registers listener to observe download progress.
Registers listener to observe upload progress.
Returns a plugin installed in HttpClient.
Returns a plugin installed in this client. Returns null
if the plugin was not previously installed.
Configures the HttpRequestRetry plugin on a per-request level.
This exception is thrown in case socket timeout (read or write) exceeded.
Adds timeout boundaries to the request. Requires HttpTimeout plugin to be installed.
Properties
Terminate HttpClient.receivePipeline if status code is not successful (>=300).