android-components / mozilla.components.lib.fetch.okhttp / OkHttpClient

OkHttpClient

class OkHttpClient : Client (source)

Client implementation using OkHttp.

Constructors

Name Summary
<init> OkHttpClient(client: OkHttpClient = OkHttpClient(), context: <ERROR CLASS>? = null)
Client implementation using OkHttp.

Inherited Properties

Name Summary
defaultHeaders val defaultHeaders: Headers
List of default headers that should be added to every request unless overridden by the headers in the request.

Functions

Name Summary
fetch fun fetch(request: Request): Response
Starts the process of fetching a resource from the network as described by the Request object. This call is synchronous.

Companion Object Functions

Name Summary
getOrCreateCookieManager fun getOrCreateCookieManager(): CookieManager

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
withInterceptors fun Client.withInterceptors(vararg interceptors: Interceptor): Client
Creates a new Client instance that will use the provided list of Interceptor instances.