send

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.

Return

A Result object containing either the successfully decoded object of type T or a Throwable representing the error that occurred.

Parameters

T

The type of object to decode the response body into.

okHttpClient

The OkHttp client used to make requests to the token service. Defaults to a PillarboxOkHttp instance.