HttpTransport

interface HttpTransport

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

The default transport (defaultHttpTransport) is a Ktor engine selected per platform (CIO on JVM/Android). Provide a custom implementation when you need a proxy, mTLS, custom timeouts, or a deterministic fake for tests.

Implementations must be safe to invoke concurrently from multiple coroutines: the client serializes nothing on its side. Network and protocol failures should surface as HttpError.TransportFailure; non-2xx responses are reported via the status code on HttpResponse and interpreted by the client.

Functions

Link copied to clipboard
abstract suspend fun execute(request: HttpRequest): HttpResponse