@AnyThread public class WebRequest extends WebMessage
WebRequest.Builder
, and fetch responses via GeckoWebExecutor.fetch(WebRequest)
.Modifier and Type | Class and Description |
---|---|
static class |
WebRequest.Builder
Builder offers a convenient way for constructing
WebRequest instances. |
Modifier and Type | Field and Description |
---|---|
ByteBuffer |
body
The body of the request.
|
static int |
CACHE_MODE_DEFAULT
Default cache mode.
|
static int |
CACHE_MODE_FORCE_CACHE
If a response is found in the cache, it will be returned, whether it's
fresh or not.
|
static int |
CACHE_MODE_NO_CACHE
Forces a conditional request to the server if there is a cache match.
|
static int |
CACHE_MODE_NO_STORE
The response will be fetched from the server without looking in
the cache, and will not update the cache with the downloaded response.
|
static int |
CACHE_MODE_ONLY_IF_CACHED
If a response is found in the cache, it will be returned, whether it's
fresh or not.
|
static int |
CACHE_MODE_RELOAD
The response will be fetched from the server without looking in
the cache.
|
int |
cacheMode
The cache mode for the request.
|
String |
method
The HTTP method for the request.
|
String |
referrer
The value of the Referer header for this request.
|
headers, uri
Constructor and Description |
---|
WebRequest(String uri)
Constructs a WebRequest with the specified URI.
|
@NonNull public final String method
@Nullable public final ByteBuffer body
public final int cacheMode
CACHE_MODE_DEFAULT
.
These modes match those from the DOM Fetch API.@Nullable public final String referrer
public static final int CACHE_MODE_DEFAULT
public static final int CACHE_MODE_NO_STORE
public static final int CACHE_MODE_RELOAD
public static final int CACHE_MODE_NO_CACHE
public static final int CACHE_MODE_FORCE_CACHE
public static final int CACHE_MODE_ONLY_IF_CACHED
public WebRequest(@NonNull String uri)
uri
- A URI String, e.g. https://mozilla.org