Interface

Request

Request

This Fetch API interface represents a resource request.

View Source js/lib.dom.d.ts, line 5673

Members

RequestCache

# cache

Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.

View Source js/lib.dom.d.ts, line 5676

RequestCredentials

# credentials

Returns 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.

View Source js/lib.dom.d.ts, line 5681

RequestDestination

# destination

Returns the kind of resource requested by request, e.g., "document" or "script".

View Source js/lib.dom.d.ts, line 5686

Headers

# headers

Returns 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.

View Source js/lib.dom.d.ts, line 5691

string

# integrity

Returns 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]

View Source js/lib.dom.d.ts, line 5696

boolean

# isHistoryNavigation

Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).

View Source js/lib.dom.d.ts, line 5701

boolean

# isReloadNavigation

Returns a boolean indicating whether or not request is for a reload navigation.

View Source js/lib.dom.d.ts, line 5706

boolean

# keepalive

Returns a boolean indicating whether or not request can outlive the global in which it was created.

View Source js/lib.dom.d.ts, line 5711

string

# method

Returns request's HTTP method, which is "GET" by default.

View Source js/lib.dom.d.ts, line 5716

RequestMode

# mode

Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.

View Source js/lib.dom.d.ts, line 5721

RequestRedirect

# redirect

Returns 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.

View Source js/lib.dom.d.ts, line 5726

string

# referrer

Returns 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.

View Source js/lib.dom.d.ts, line 5731

ReferrerPolicy

# referrerPolicy

Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.

View Source js/lib.dom.d.ts, line 5736

AbortSignal

# signal

Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.

View Source js/lib.dom.d.ts, line 5741

string

# url

Returns the URL of request as a string.

View Source js/lib.dom.d.ts, line 5746