Package-level declarations

Pluggable HTTP transport: the HttpTransport interface, the HttpRequest / HttpResponse data classes, and the HttpError family.

Types

Link copied to clipboard

Failure raised by an HttpTransport before the YAXI service has had a chance to answer (DNS, TLS, connect, read, write, decode). Non-2xx HTTP statuses do not use this hierarchy; HttpResponse.status carries them and the client maps them to the appropriate RoutexError subclass.

Link copied to clipboard

HTTP method used by the YAXI Routex API. The client only issues GET and POST.

Link copied to clipboard
data class HttpRequest(val method: HttpMethod, val url: Url, val headers: Headers = Headers.Empty, val body: ByteArray? = null)

Single HTTP request issued by the HttpTransport layer.

Link copied to clipboard
data class HttpResponse(val status: Int, val headers: Headers, val body: ByteArray)

Single HTTP response surfaced by the HttpTransport layer.

Link copied to clipboard
interface HttpTransport

Transport contract for the YAXI Routex client: a single suspend function that issues an HttpRequest and returns the corresponding HttpResponse.

Functions

Link copied to clipboard

Returns the built-in HTTP transport for the current platform, Ktor CIO on JVM and Android. Consumers who need to control engine settings (proxy, TLS pinning, retries, etc.) can implement HttpTransport directly.