Skip to content

HttpTransport

//fluxbase-kotlin/io.github.nimbleflux.fluxbase.core/HttpTransport

interface HttpTransport

SPI for the actual HTTP I/O. The SDK’s FluxbaseHttpClient delegates all wire calls to this interface, which has a production implementation (Ktor-backed, for JVM/Android) and is the seam used by tests: io.github.nimbleflux.fluxbase.core.test.RecordingHttp is a fake that records requests instead of sending them.

This mirrors the TS SDK’s separation where FluxbaseFetch wraps global.fetch() and tests inject a fake object with the same method shape.

KtorHttpTransport
Name Summary
request [jvm]
abstract suspend fun request(method: HttpMethod, path: String, body: Any?, headers: Map<String, String>): HttpResponse
Perform an HTTP method request to path (relative to the base URL). body is a pre-serialized value (will be JSON-encoded by the transport) or null for GET/DELETE/HEAD. headers are per-request overrides merged on top of the client defaults. Returns the raw response body as text.
requestBytes [jvm]
abstract suspend fun requestBytes(method: HttpMethod, path: String, headers: Map<String, String>): ByteArray
Perform an HTTP method request and return the response body as raw bytes — the binary-safe path used by FluxbaseHttpClient.getBytes (e.g. storage downloads). Unlike request, the body never passes through a text/charset decode, so non-UTF-8 bytes (images, archives) survive intact. Mirrors the TS SDK’s getBlob in sdk/src/fetch.ts.