RequestSender

A helper object responsible for sending HTTP requests using OkHttp and handling JSON serialization.

Properties

Link copied to clipboard
val MIME_TYPE_JSON: MediaType

Represents the MIME type for JSON data.

Functions

Link copied to clipboard
inline fun <T> Request.send(okHttpClient: OkHttpClient = PillarboxOkHttp()): Result<T>

Sends the current request and attempts to decode the response body into an object of type T.

Link copied to clipboard
inline fun <T> T.toJsonRequestBody(): RequestBody

Converts an object of type T to a RequestBody with JSON content type.