android-components / mozilla.components.browser.engine.gecko.fetch / GeckoViewFetchClient

GeckoViewFetchClient

class GeckoViewFetchClient : Client (source)

GeckoView (GeckoWebExecutor) based implementation of Client.

Constructors

Name Summary
<init> GeckoViewFetchClient(context: <ERROR CLASS>, runtime: GeckoRuntime = GeckoRuntime.getDefault(context), maxReadTimeOut: Pair<Long, TimeUnit> = Pair(MAX_READ_TIMEOUT_MINUTES, TimeUnit.MINUTES))
GeckoView (GeckoWebExecutor) based implementation of Client.

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 Properties

Name Summary
MAX_READ_TIMEOUT_MINUTES const val MAX_READ_TIMEOUT_MINUTES: Long

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.