Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class BearerAuthenticatorFromProvider(token: () -> String, abbreviation: String = "Bearer") : Interceptor
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The cached response will be returned only when the Internet is available as OkHttp is designed like that. When the Internet is available and data is cached, it returns the data from the cache. Even when the data is cached and the Internet is not available, it returns with the error "no internet available". We can use the following ForceCacheInterceptor at the Application layer in addition to the above one (NetworkCacheInterceptor, only if not enabled from the server) First use addNetworkInterceptor(NetworkCacheInterceptor) then add this addInterceptor(ForceCacheInterceptor) on your http client builder
Link copied to clipboard
Link copied to clipboard
Usage: MockInterceptor( Pair("/bar", """{"foo":"baz"}"""))
Link copied to clipboard
class NetworkCacheInterceptor(maxAge: Int = 1, timeUnit: TimeUnit = TimeUnit.MINUTES, cacheControlAbbreviation: String = "Cache-control") : Interceptor
In order to cache the response build cache see @see Context.retrofitCache()
Link copied to clipboard
class RetryRequestInterceptor(maxTries: Int = 3, delayBetweenRetry: Long = TimeUnit.SECONDS.toMillis(3)) : Interceptor
Link copied to clipboard
class TooManyRequestsInterceptor(tooManyRequestsResponseCode: Int = 429, customMessage: String? = null) : Interceptor
Link copied to clipboard
Link copied to clipboard