Interceptor

interface Interceptor

An object that intercepts requests before being sent and responses before being returned. The intercept function is a suspending function, meaning it is invoked as a coroutine. The coroutine shares the kotlin.coroutines.CoroutineContext used when the HTTP call is first initiated. Typically, this means that all interceptors, along with the HTTP call, are invoked within the same CoroutineScope, and thus typically the same parent kotlinx.coroutines.Job.

Types

Link copied to clipboard
interface Chain<T>

A continuation of the interceptor chain.

Functions

Link copied to clipboard
abstract suspend fun <T> intercept(request: <Error class: unknown class>, chain: Interceptor.Chain<T>): <Error class: unknown class><T>