KenworkHttpClient

Shared KMP client policy. Products provide the platform engine and own request semantics.

Every client built here gets the same policy: JSON content negotiation using the supplied Json (default DefaultJson) and redirects disabled unless followRedirects is true. Nothing else is installed — no auth, retry, timeout, or logging (see docs/platforms.md).

Properties

Link copied to clipboard
val DefaultJson: Json

The default JSON policy: ignores unknown keys so additive server changes don't break decoding. Shared rather than rebuilt per client, since each Json instance keeps its own serializer cache.

Functions

Link copied to clipboard
fun create(engine: HttpClientEngine, json: Json = DefaultJson, followRedirects: Boolean = false): HttpClient

Builds a client over an existing engine. The engine stays caller-owned: close it yourself once every client using it has finished.

fun <T : HttpClientEngineConfig> create(engineFactory: HttpClientEngineFactory<T>, json: Json = DefaultJson, followRedirects: Boolean = false): HttpClient

Builds a client whose engine is created (and closed with the client) from engineFactory, e.g. OkHttp on Android/JVM or Darwin on iOS.