HttpConfiguration

@Serializable
data class HttpConfiguration(var requestTimeoutMillis: Long? = null, var connectTimeoutMillis: Long? = null, var socketTimeoutMillis: Long? = null, var maxRequestRetry: Int = 3, var retryStrategy: RetryStrategy? = null, var retryDelay: Long = 3000, var proxy: ProxyConfig? = null, var additionalHeaders: Map<String, Any?>? = null)

A class containing the configuration for the bot http client.

Constructors

Link copied to clipboard
constructor(requestTimeoutMillis: Long? = null, connectTimeoutMillis: Long? = null, socketTimeoutMillis: Long? = null, maxRequestRetry: Int = 3, retryStrategy: RetryStrategy? = null, retryDelay: Long = 3000, proxy: ProxyConfig? = null, additionalHeaders: Map<String, Any?>? = null)

Properties

Link copied to clipboard
@Transient
var additionalHeaders: Map<String, Any?>?

Headers that will be applied to every request.

Link copied to clipboard

Specifies a connection timeout in milliseconds. The connection timeout is the time period in which a client should establish a connection with a server.

Link copied to clipboard

Specifies a http request maximum retry if had some exceptions

Link copied to clipboard
@Transient
var proxy: ProxyConfig?

Specifies proxy that will be used for http calls.

Link copied to clipboard
val HttpResponse.rawStatus: Int
Link copied to clipboard

Specifies a request timeout in milliseconds. The request timeout is the time period required to process an HTTP call: from sending a request to receiving a response.

Link copied to clipboard

Multiplier for timeout at each retry, in milliseconds i.e., for the base value maxRequestRetry the attempts will be in 3, 6, 9 seconds

Link copied to clipboard

By default client uses retryOnExceptionOrServerErrors strategy, but you can define custom.

Link copied to clipboard

Specifies a socket timeout (read and write) in milliseconds. The socket timeout is the maximum time of inactivity between two data packets when exchanging data with a server.

Functions