RequestOptions

data class RequestOptions(var body: String? = null, var headers: Map<String, String>? = null, var timeout: Duration? = null, var retries: Int? = null, var retryWhen: RetryWhen? = null, var validate: Validate? = null)

Data class representing the options for a request.

Constructors

Link copied to clipboard
constructor(body: String? = null, headers: Map<String, String>? = null, timeout: Duration? = null, retries: Int? = null, retryWhen: RetryWhen? = null, validate: Validate? = null)

Properties

Link copied to clipboard
var body: String?

The body of the request. This can be null if the request does not have a body.

Link copied to clipboard

The headers of the request. This can be null if the request does not have any headers.

Link copied to clipboard
var retries: Int?

The number of retries for the request. This can be null if there are no retries specified.

Link copied to clipboard

A predicate that determines when to retry the request. If this is null, the request will be retried as long as the number of attempts is less or equal than the number of retries.

Link copied to clipboard

The timeout for the request. This can be null if there is no specific timeout for the request.

Link copied to clipboard

A predicate that validates the response. If this is null, the response will be considered valid if the status code is between the range 200-299.