Package-level declarations

Types

Link copied to clipboard
class Request(val method: Method, val url: String, options: RequestOptions.() -> Unit)

Class representing an HTTP request.

Link copied to clipboard
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.

Link copied to clipboard
class Response(val body: ByteArray, val length: Int, val statusCode: Short, val headers: Map<String, String>)

Class representing an HTTP response.

Link copied to clipboard
typealias RetryWhen = suspend (request: Request, response: Response, attempt: Int) -> Boolean

Type alias for a function that determines when to retry a request.

Link copied to clipboard
typealias Validate = (response: Response) -> Boolean

Type alias for a function that validates a response.