okhttp / okhttp3 / Interceptor

Interceptor

interface Interceptor

Observes, modifies, and potentially short-circuits requests going out and the corresponding responses coming back in. Typically interceptors add, remove, or transform headers on the request or response.

Types

Name Summary
Chain interface Chain

Functions

Name Summary
intercept abstract fun intercept(chain: Chain):Response

Companion Object Functions

Name Summary
invoke Constructs an interceptor for a lambda. This compact syntax is most useful for inline interceptors.operator fun invoke(block: (chain: Chain) ->Response):Interceptor