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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder offers a convenient way for constructingWebRequestinstances.static @interfaceCache mode definitions for web requests. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanIf true, do not use newer protocol features that might have interop problems on the Internet.final ByteBufferThe body of the request.static final intDefault cache mode.static final intIf a response is found in the cache, it will be returned, whether it's fresh or not.static final intForces a conditional request to the server if there is a cache match.static final intThe response will be fetched from the server without looking in the cache, and will not update the cache with the downloaded response.static final intIf a response is found in the cache, it will be returned, whether it's fresh or not.static final intThe response will be fetched from the server without looking in the cache.final intThe cache mode for the request.final StringThe HTTP method for the request.final StringThe value of the Referer header for this request.Fields inherited from class org.mozilla.geckoview.WebMessage
headers, uri -
Constructor Summary
Constructors -
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
-