Request
interface
interface Request extends BodyThis Fetch API interface represents a resource request.
variable
var Request: { … }This Fetch API interface represents a resource request.
Constructors
constructor
new Request(input: RequestInfo | URL, init?: RequestInit): RequestProperties
cache
readonly cache: RequestCacheReturns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.
credentials
readonly credentials: RequestCredentialsReturns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.
destination
readonly destination: RequestDestinationReturns the kind of resource requested by request, e.g., "document" or "script".
headers
readonly headers: HeadersReturns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.
integrity
readonly integrity: stringReturns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
isHistoryNavigation
readonly isHistoryNavigation: booleanReturns a boolean indicating whether or not request is for a history navigation (a.k.a. back-forward navigation).
isReloadNavigation
readonly isReloadNavigation: booleanReturns a boolean indicating whether or not request is for a reload navigation, e.g. a refresh triggered via the browser's reload control or by calling location.reload().
keepalive
readonly keepalive: booleanReturns a boolean indicating whether or not request can outlive the global in which it was created.
method
readonly method: stringReturns request's HTTP method, which is "GET" by default.
mode
readonly mode: RequestModeReturns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.
redirect
readonly redirect: RequestRedirectReturns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
referrer
readonly referrer: stringReturns the referrer of request. Its value can be a same-origin URL if
explicitly set in init, the empty string to indicate no referrer, and
"about:client" when defaulting to the global's default. This is used during
fetching to determine the value of the Referer header of the request
being made.
referrerPolicy
readonly referrerPolicy: ReferrerPolicyReturns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.
signal
readonly signal: AbortSignalReturns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.
url
readonly url: stringReturns the URL of request as a string.
prototype
readonly prototype: RequestMethods
clone
clone(): Request