source_Integrity) value of the request (e.g., `
sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE= ` ).

` keepalive `

    

The ` keepalive ` option can be used to allow the request to outlive the page.
Fetch with the ` keepalive ` flag is a replacement for the [ `
Navigator.sendBeacon() ` ](/en-US/docs/Web/API/Navigator/sendBeacon) API.

` method `

    

The request method, e.g., ` "GET" ` , ` "POST" ` . The default is ` "GET" ` .
Note that the [ ` Origin ` ](/en-US/docs/Web/HTTP/Headers/Origin) header is
not set on Fetch requests with a method of [ ` HEAD ` ](/en-
US/docs/Web/HTTP/Methods/HEAD) or [ ` GET ` ](/en-
US/docs/Web/HTTP/Methods/GET) . (This behavior was corrected in Firefox 65 â
see [ Firefox bug 1508661 ](https://bugzil.la/1508661) .) Any string which is
a case-insensitive match for one of the methods in [ RFC 9110
](https://www.rfc-editor.org/rfc/rfc9110#name-overview) will be uppercased
automatically. If you want to use a custom method (like ` PATCH ` ), you
should uppercase it yourself.

` mode `

    

The mode you want to use for the request, e.g., ` cors ` , ` no-cors ` , or `
same-origin ` .

` priority `

    

Specifies the priority of the fetch request relative to other requests of the
same type. Must be one of the following strings:

` high `

    

A high priority fetch request relative to other requests of the same type.

` low `

    

A low priority fetch request relative to other requests of the same type.

` auto `

    

Automatically determine the priority of the fetch request relative to other
requests of the same type (default).

` redirect `

    

How to handle a ` redirect ` response:

` follow `

    

Automatically follow redirects. Unless otherwise stated the redirect mode is
set to ` follow ` .

` error `

    

Abort with an error if a redirect occurs.

` manual `

    

Caller intends to process the response in another context. See [ WHATWG fetch
standard ](https://fetch.spec.whatwg.org/#concept-request-redirect-mode) for
more information.

` referrer `

    

A string specifying the referrer of the request. This can be a same-origin
URL, ` about:client ` , or an empty string.

` referrerPolicy `

    

Specifies the [ referrer policy ](https://w3c.github.io/webappsec-referrer-
policy/#referrer-policies) to use for the request. May be one of ` no-referrer
` , ` no-referrer-when-downgrade ` , ` same-origin ` , ` origin ` , ` strict-
origin ` , ` origin-when-cross-origin ` , ` strict-origin-when-cross-origin `
, or ` unsafe-url ` .

` signal `

    

An [ ` AbortSignal ` ](/en-US/docs/Web/API/AbortSignal) object instance;
allows you to communicate with a fetch request and abort it if desired via an
[ ` AbortController ` ](/en-US/docs/Web/API/AbortController) .

###  Return value

A [ ` Promise ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
that resolves to a [ ` Response ` ](/en-US/docs/Web/API/Response) object.

###  Exceptions

` AbortError ` [ ` DOMException ` ](/en-US/docs/Web/API/DOMException)

    

The request was aborted due to a call to the [ ` AbortController ` ](/en-
US/docs/Web/API/AbortController) [ ` abort() ` ](/en-
US/docs/Web/API/AbortController/abort "abort\(\)") method.

` NotAllowedError ` [ ` DOMException ` ](/en-US/docs/Web/API/DOMException)

    

Usage of the [ Topics API ](/en-US/docs/Web/API/Topics_API) is specifically
disallowed by a [ ` browsing-topics ` ](/en-
US/docs/Web/HTTP/Headers/Permissions-Policy/browsing-topics) [ Permissions
Policy ](/en-US/docs/Web/HTTP/Permissions_Policy) , and a ` fetch() ` request
was made with ` browsingTopics: true ` .

[ ` TypeError ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)

    

Can occur for the following reasons:

Reason  |  Failing examples   
---|---  
Invalid header name.  | 
    
    
    // space in "C ontent-Type"
    const headers = {
      'C ontent-Type': 'text/xml',
      'Breaking-Bad': '<3',
    };
    fetch('https://example.com/', { headers });