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 the request timeout is exceeded. The request timeout is the time period required to process an HTTP call: from sending a request to receiving a response.
HttpSend pipeline interceptor function
A plugin that allows you to configure the following timeouts:
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.
Functions
Default response validation. Check the response status code in range (0..299).
Installs the UserAgent plugin with a browser-like user agent.
Configure client charsets.
This exception is thrown in case the connection timeout is exceeded. It indicates the client took too long to establish a connection with a server.
Converts a 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.
Converts 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.
Installs the UserAgent plugin with a CURL 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 the socket timeout (read or write) is exceeded. It indicates the time between two data packets when exchanging data with a server was too long.
Adds timeout boundaries to the request. Requires the HttpTimeout plugin to be installed.
Properties
Terminate HttpClient.receivePipeline if status code is not successful (>=300).