---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Fetch RequestInit - Scoped, Global

# Fetch RequestInit - Scoped, Global {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 8 minutes to read  
The RequestInit API provides options to configure a Fetch request.

You can pass a RequestInit object into the Request() constructor, or directly into the fetch() function call. You can also construct a Request with a RequestInit() call, and
pass the Request to a fetch() call along with another RequestInit(). If you do this when the same option is set in both places, then the value passed directly into fetch() is
used.  
This API is part of a set of Fetch APIs, which provide various actions for fetching resources from external websites. The full Fetch API collection includes:

* [Fetch - fetch(String resource, Object options)](https://servicenow-prod.fluidtopics.net/BjgPgdTN~sDlsIbr8dv_gg#fetch.fetch_S_O "Starts the process of fetching a resource from the network and returns a promise that is fulfilled once the response is available."): Starts the process of fetching a resource from the network.
* [Fetch Headers - Scoped, Global](https://servicenow-prod.fluidtopics.net/QpYPN4iIPDFYc0lpxGykDQ#Fetch.HeadersAPI "The Fetch Headers API allows you to retrieve, set, add to, and remove headers from a list of request or response headers."): Retrieve and modify request and response headers.
* [Fetch Request - Scoped, Global](https://servicenow-prod.fluidtopics.net/W0gJkwIJSZxt9ZBuK47pfg#Fetch.RequestAPI "The Fetch Request API contains methods for creating or retrieving a Request object to allow applications to asynchronously request resources, such as JSON, text, or binary data, from a server, and handle the response. This API supports various HTTP methods like GET, POST, PUT, DELETE, and so on."): Create a new request object.
* [Fetch RequestInit - Scoped, Global](https://servicenow-prod.fluidtopics.net/u~mCRUkZ0_odSqZr~o5F4A#Fetch.RequestInitAPI "The RequestInit API provides options to configure a Fetch request."): Set options to configure a fetch request.
* [Fetch Response - Scoped,Global](https://servicenow-prod.fluidtopics.net/dRaKslSlaxFBm4A0S5Hneg#Fetch.ResponseAPI "The Fetch Response API provides methods for creating a new Response object and for handling the response body created by a Fetch Request API method."): Create a new response object.
{#Fetch.RequestInitAPI__ul_akb_fsf_pdc}

To support fetch actions, the system property, `glide.hosts.allowlist`, allows controls over what hosts a fetch method can access. It applies to HTTP APIs like RestMessageV2 and those mentioned above. For more
information about `glide.hosts.allowlist`, see [Available system properties](https://www.servicenow.com/docs/access?context=r_AvailableSystemProperties&version=australia&pubname=australia-platform-administration&ft:locale=en-US).

## Fetch RequestInit - RequestInit {#ariaid-title2}

Set options to configure a Fetch request. You can pass a RequestInit object into the Request() constructor or directly into the fetch() function call.

### RequestInit properties {#fetch.requestInit-requestInit__section_jcc_fdq_12c}

The RequestInit API supports several optional properties that can be used to configure HTTP request behavior. Its properties include `method` (HTTP method), `headers` (request
headers), `body` (data to send), `mode` (CORS mode), `credentials` (authentication details), `cache` (cache behavior), and others like `redirect`,
`referrer`, and `integrity`. These options let you fine-tune request behavior for various use cases. To read more in-depth explanations about each property, see <https://developer.mozilla.org/en-US/docs/Web/API/RequestInit>.
{#fetch.requestInit-requestInit__table_t5x_2qw_jdc__entry__2}

| Property name | Description |
|-|-|
| attributionReporting | Optional. Indicates that you want the request's response to be able to register a JavaScript-based attribution source or attribution trigger. `attributionReporting` is an object containing the following properties: * eventSourceEligible: Boolean. If set to `true`, the request's response is eligible to register an attribution source. If set to `false`, it isn't eligible for registration as an attribution source. * triggerEligible: Boolean. If set to `true`, the request's response is eligible to register an attribution trigger. If set to `false`, it isn't eligible for registration as an attribution trigger. {#fetch.requestInit-requestInit__ul_e4n_ljy_12c} Data type: Object |
| body | Optional. The request body contains content to send to the server, for example in a POST or PUT request. Accepted types: * ArrayBuffer * a string * Blob * DataView * File * FormData * ReadableStream * TypedArray * URLSearchParams {#fetch.requestInit-requestInit__ul_f4n_ljy_12c} |
| browsingTopics | Optional. Flag indicating whether the selected topics for the current user should be sent in a Sec-Browsing-Topics header with the associated request. Accepted values: * true: Selected topics for the current user should be sent in a Sec-Browsing-Topics header * false: Selected topics for the current user shouldn't be sent in a Sec-Browsing-Topics header. {#fetch.requestInit-requestInit__ul_nql_b3q_12c} Data type: Boolean |
| cache | Optional. The cache mode to use for the request. Accepted values: * default: The browser looks in its HTTP cache for a response matching the request. * force-cache: The browser looks in its HTTP cache for a response matching the request. * no-cache: The browser looks in its HTTP cache for a response matching the request. * no-store: The browser fetches the resource from the remote server without first looking in the cache, and will not update the cache with the downloaded resource. * only-if-cached: The browser looks in its HTTP cache for a response matching the request. * reload: The browser fetches the resource from the remote server without first looking in the cache, but then will update the cache with the downloaded resource. {#fetch.requestInit-requestInit__ul_g4n_ljy_12c} The `only-if-cached` mode can only be used if the request's mode is `same-origin`. Cached redirects will be followed if the request's `redirect` property is `follow` and the redirects do not violate the `same-origin` mode. Data type: String |
| credentials | Optional. Controls whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected. Credentials are cookies, TLS client certificates, or authentication headers containing a username and password. Accepted values: * include: Always include credentials, even for cross-origin requests. Note: Including credentials in cross-origin requests can make a site vulnerable to CSRF attacks, so even if `credentials` is set to `include`, the server must also agree to their inclusion by including the Access-Control-Allow-Credentials in its response. Additionally, in this situation the server must explicitly specify the client's origin in the Access-Control-Allow-Origin response header (that is, `*`is not allowed). * omit: Never send credentials in the request or include credentials in the response. * same-origin: Only send and include credentials for same-origin requests. {#fetch.requestInit-requestInit__ul_h4n_ljy_12c} Default: same-origin Data type: String |
| headers | Optional. Any headers to add to your request, contained within a Headers object or an object literal whose keys are the names of headers and whose values are the header values. Many headers are set automatically by the browser and can't be set by a script; these are called Forbidden header names. If the `mode` option is set to `no-cors`, you can only set CORS-safelisted request headers. Data type: String |
| integrity | Optional. Contains the subresource integrity value of the request. This is checked when the resource is fetched. The browser computes the hash of the fetched resource using the specified algorithm, and if the result does not match the value specified, the browser rejects the fetch request with a network error. The format of this option is `<hash-algo>-<hash-source>` where: * \<hash-algo\>: is one of the following values: sha256, sha384, or sha512. * \<hash-source\>: is the Base64-encoding of the result of hashing the resource with the specified hash algorithm. {#fetch.requestInit-requestInit__ul_i4n_ljy_12c} Defaults to an empty string. Data type: String |
| keepalive | Optional. Flag that indicates whether to abort the associated request if the page that initiated it is unloaded before the request is complete. The body size for `keepalive` requests is limited to 64 kibibytes. Valid values: * true: The browser doesn't abort the associated request. * false: Aborts the associated request. {#fetch.requestInit-requestInit__ul_j4n_ljy_12c} Data type: Boolean Default: false |
| method | Optional. The request method. Data type: String Default: GET |
| mode | Optional. Sets cross-origin behavior for the request. Valid values: * same-origin: Disallows cross-origin requests. If a `same-origin` request is sent to a different origin, the result is a network error. * cors: If the request is cross-origin then it will use the Cross-Origin Resource Sharing (CORS) mechanism. Only CORS-safelisted response headers are exposed in the response. * no-cors: Disables CORS for cross-origin requests. This option comes with the following restrictions: * The method may only be one of `HEAD`, `GET` or `POST`. * The headers may only be CORS-safelisted request headers, with the additional restriction that the Range header is also not allowed. This also applies to any headers added by service workers. * The response is opaque, meaning that its headers and body are not available to JavaScript, and its status code is always `0`. {#fetch.requestInit-requestInit__ul_l4n_ljy_12c} * navigate: Used only by HTML navigation. A `navigate` request is created only while navigating between documents. {#fetch.requestInit-requestInit__ul_k4n_ljy_12c} Data type: String Default: cors |
| priority | Optional. Specifies the priority of the fetch request relative to other requests of the same type. Valid values: * auto: No user preference for the fetch priority. It is used if no value is set or if an invalid value is set. * 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. {#fetch.requestInit-requestInit__ul_m4n_ljy_12c} Data type: String Default: auto |
| redirect | Optional. Determines the browser's behavior in case the server replies with a redirect status. Accepted values: * follow: Automatically follow redirects. * error: Reject the promise with a network error when a redirect status is returned. * manual: Return a response with almost all fields filtered out, to enable a service worker to store the response and later replay it. {#fetch.requestInit-requestInit__ul_n4n_ljy_12c} Data type: String Default: follow |
| referrer | Optional. A string specifying the value to use for the request's Referrer header. Accepted values and data types: * about:client: Set the `Referrer` header to the default value for the context of the request (for example, the URL of the page that made the request). * empty string: Omit the `Referrer` header. * same-origin relative or absolute URL: Set the `Referrer` header to the given value. Relative URLs are resolved relative to the URL of the page that made the request. {#fetch.requestInit-requestInit__ul_o4n_ljy_12c} Default: about:client |
| referrerPolicy | Optional. A string that sets a policy for the Referrer header. The syntax and semantics of this option are exactly the same as for the Referrer-Policy header. Data type: String |
| signal | Optional. An AbortSignal. If this option is set, the request can be canceled by calling abort() on the corresponding `AbortController`. Data type: String |
[Table 1. RequestInit properties]

{#fetch.requestInit-requestInit__table_t5x_2qw_jdc} {#fetch.requestInit-requestInit__table_mbs_ppw_jdc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 2. Returns]

{#fetch.requestInit-requestInit__table_mbs_ppw_jdc}  

### Pass options into fetch()

This example shows how to pass the method, body, and headers options directly into the fetch() method:

    async function post() {
      const response = await fetch("https://example.org/post", {
        method: "POST",
        body: JSON.stringify({ username: "example" }),
        headers: {
          "Content-Type": "application/json",
        },
      });

      console.log(response.status);
    }

### Pass options into the Request() constructor {#fetch.requestInit-requestInit__example_eg5_ckb_jdc}

This example shows how to create a Request and pass the method, body, and headers options into the constructor and pass the request into fetch():

    async function post() {
      const request = new Request("https://example.org/post", {
        method: "POST",
        body: JSON.stringify({ username: "example" }),
        headers: {
          "Content-Type": "application/json",
        },
      });

      const response = await fetch(request);

      console.log(response.status);
    }

### Pass options into both Request() and fetch() {#fetch.requestInit-requestInit__example_q3w_3kb_jdc}

This example shows ho to create a Request() and pass the method, body, and headers options into the constructor. The script then passes the request into fetch() along with the body and referrer
options.  
In this case the request will be sent with the following options:

* method: "POST"
* headers: {"Content-Type": "application/json"}
* body: '{"username":"example2"}'
* referrer: ""
{#fetch.requestInit-requestInit__ul_zb4_qkb_jdc}

    async function post() {
      const request = new Request("https://example.org/post", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ username: "example1" }),
      });

      const response = await fetch(request, {
        body: JSON.stringify({ username: "example2" }),
        referrer: "",
      });

      console.log(response.status);
    }


