Package org.mozilla.geckoview
Class WebRequest
Object
org.mozilla.geckoview.WebMessage
org.mozilla.geckoview.WebRequest
WebRequest represents an HTTP[S] request. The typical pattern is to create instances of this
class via
WebRequest.Builder
, and fetch responses via GeckoWebExecutor.fetch(WebRequest)
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder offers a convenient way for constructingWebRequest
instances.static @interface
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
If true, do not use newer protocol features that might have interop problems on the Internet.final ByteBuffer
The body of the request.static final int
Default cache mode.static final int
If a response is found in the cache, it will be returned, whether it's fresh or not.static final int
Forces a conditional request to the server if there is a cache match.static final int
The response will be fetched from the server without looking in the cache, and will not update the cache with the downloaded response.static final int
If a response is found in the cache, it will be returned, whether it's fresh or not.static final int
The response will be fetched from the server without looking in the cache.final int
The cache mode for the request.final String
The HTTP method for the request.final String
The value of the Referer header for this request.Fields inherited from class org.mozilla.geckoview.WebMessage
headers, uri
-
Constructor Summary
-
Method Summary
-
Field Details
-
method
The HTTP method for the request. Defaults to "GET". -
body
The body of the request. Must be a directly-allocated ByteBuffer. May be null. -
cacheMode
public final int cacheModeThe cache mode for the request. SeeCACHE_MODE_DEFAULT
. These modes match those from the DOM Fetch API.- See Also:
-
beConservative
public final boolean beConservativeIf true, do not use newer protocol features that might have interop problems on the Internet. Intended only for use with critical infrastructure. -
referrer
The value of the Referer header for this request. -
CACHE_MODE_DEFAULT
public static final int CACHE_MODE_DEFAULTDefault cache mode. Normal caching rules apply.- See Also:
-
CACHE_MODE_NO_STORE
public static final int CACHE_MODE_NO_STOREThe response will be fetched from the server without looking in the cache, and will not update the cache with the downloaded response.- See Also:
-
CACHE_MODE_RELOAD
public static final int CACHE_MODE_RELOADThe response will be fetched from the server without looking in the cache. The cache will be updated with the downloaded response.- See Also:
-
CACHE_MODE_NO_CACHE
public static final int CACHE_MODE_NO_CACHEForces a conditional request to the server if there is a cache match.- See Also:
-
CACHE_MODE_FORCE_CACHE
public static final int CACHE_MODE_FORCE_CACHEIf a response is found in the cache, it will be returned, whether it's fresh or not. If there is no match, a normal request will be made and the cache will be updated with the downloaded response.- See Also:
-
CACHE_MODE_ONLY_IF_CACHED
public static final int CACHE_MODE_ONLY_IF_CACHEDIf a response is found in the cache, it will be returned, whether it's fresh or not. If there is no match from the cache, 504 Gateway Timeout will be returned.- See Also:
-
-
Constructor Details
-
WebRequest
Constructs a WebRequest with the specified URI.- Parameters:
uri
- A URI String, e.g. https://mozilla.org
-