HttpEngine

interface HttpEngine

The SDK's one outbound seam.

An interface rather than a hard OkHttp dependency so callers can supply their own client (proxies, interceptors, custom trust stores are all common in partner backends) and so tests need no local server.

Inheritors

Functions

Link copied to clipboard
open suspend fun delete(url: String, headers: Map<String, String> = emptyMap()): HttpResponse

DELETE url.

Link copied to clipboard
abstract suspend fun get(url: String, headers: Map<String, String> = emptyMap()): HttpResponse

GET url and return the response without interpreting it.

Link copied to clipboard
abstract suspend fun post(url: String, body: String, headers: Map<String, String> = emptyMap()): HttpResponse

POST body to url and return the response without interpreting it.

Link copied to clipboard
open suspend fun put(url: String, body: ByteArray, contentType: String, headers: Map<String, String> = emptyMap()): HttpResponse

PUT raw bytes to url.