Request
The Request interface of the Fetch API represents a resource request.
Documentation Request by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
method: StringContains the request's method (GET, POST, etc.)
url: StringContains the URL of the request.
headers: HeadersContains the associated Headers object of the request.
destination: RequestDestinationReturns a string from the RequestDestination enum describing the request's destination. This is a string indicating the type of content being requested.
referrer: StringContains the referrer of the request (e.g., client).
referrerPolicy: ReferrerPolicyContains the referrer policy of the request (e.g., no-referrer).
mode: RequestModeContains the mode of the request (e.g., cors, no-cors, same-origin, navigate.)
credentials: RequestCredentialsContains the credentials of the request (e.g., "omit", "same-origin", "include"). The default is "same-origin".
cache: RequestCacheContains the cache mode of the request (e.g., default, reload, no-cache).
redirect: RequestRedirectContains the mode for how redirects are handled. It may be one of follow, error, or manual.
integrity: StringContains the subresource integrity value of the request (e.g., sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=).
signal: AbortSignalbodyUsed: Boolclone(): RequestCreates a copy of the current Request object.
| Returns |
|---|
| Request |
arrayBuffer(): js.lib.Promise<js.lib.ArrayBuffer>| Returns |
|---|
| js.lib.Promise<js.lib.ArrayBuffer> |
blob(): js.lib.Promise<Blob>| Returns |
|---|
| js.lib.Promise<Blob> |
formData(): js.lib.Promise<FormData>| Returns |
|---|
| js.lib.Promise<FormData> |
json(): js.lib.Promise<Dynamic>| Returns |
|---|
| js.lib.Promise<Dynamic> |
text(): js.lib.Promise<String>| Returns |
|---|
| js.lib.Promise<String> |
new(input: Request, ?init: Null<RequestInit>): Void| Name | Type | Default |
|---|---|---|
input |
Request | |
init |
Null<RequestInit> | (optional) |