FetchAPI
Types
formData
Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". See FormData on MDN
Module
There are methods and helpers defined in FormData .
formDataEntryValue
headers
This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. See Headers on MDN
Module
There are methods and helpers defined in Headers .
referrerPolicy
request
This Fetch API interface represents a resource request. See Request on MDN
Record fields
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. Read more on MDN
destination
Returns the kind of resource requested by request, e.g., "document" or "script". Read more on MDN
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.
Read more on MDN
referrerPolicy
Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. Read more on MDN
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. Read more on MDN
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. Read more on MDN
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. Read more on MDN
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. Read more on MDN
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] Read more on MDN
keepalive
Returns a boolean indicating whether or not request can outlive the global in which it was created. Read more on MDN
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. Read more on MDN
Module
There are methods and helpers defined in Request .
requestCache
requestCredentials
requestDestination
requestInfo
requestInit
Record fields
method
A string to set request's method.
headers
A Headers object, an object literal, or an array of two-item arrays to set request's headers.
referrer
A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
mode
A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.
credentials
A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
cache
A string indicating how the request will interact with the browser's cache to set request's cache.
redirect
A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
integrity
A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
keepalive
A boolean to set request's keepalive.
priority
window
Can only be null. Used to disassociate request from any Window.
requestMode
requestPriority
requestRedirect
response
This Fetch API interface represents the response to a request. See Response on MDN
Record fields
Module
There are methods and helpers defined in Response .