nx.js
Interfaces

RequestInit

Options accepted by fetch() and the Request constructor.

The shape mirrors the Web Fetch standard, but not every field has an equivalent on the Switch runtime. There is no Window, no same-origin policy, no CORS enforcement, and no shared HTTP cache. The notes on each field below describe how nx.js actually treats them.

See

fetch

Properties

PropertyTypeDescription
body?null | BodyInitHonored — the request body. May be a BodyInit (string, ArrayBuffer, FormData, URLSearchParams, Blob, or ReadableStream) or null.
cache?RequestCacheIgnored on Switch. nx.js does not maintain an HTTP cache; every fetch() performs a fresh network request. The value is stored on the resulting Request object for spec compatibility but has no effect on networking behavior.
credentials?RequestCredentialsIgnored on Switch. There is no shared cookie jar or credential store, and there is no same-origin policy to gate. The value is preserved on the Request for spec compatibility only.
headers?HeadersInitHonored — request headers (Headers, an object literal, or an array of [name, value] pairs).
integrity?stringNot enforced on Switch. Subresource integrity is not validated by the runtime; the value is stored on the Request but no hash check is performed.
keepalive?booleanIgnored on Switch. There is no concept of a page lifetime that keepalive would extend a request beyond.
method?stringHonored — HTTP method ('GET', 'POST', etc.). Defaults to 'GET'.
mode?RequestModeIgnored on Switch. There is no browser to enforce CORS / same-origin checks. All cross-origin requests are simply performed. The value is preserved on the Request for spec compatibility.
redirect?RequestRedirectHonored — controls how 3xx redirects are handled ('follow' (default), 'error', or 'manual').
referrer?stringIgnored on Switch. No Referer header is set automatically; supply one via headers if needed.
referrerPolicy?ReferrerPolicyIgnored on Switch. Referrer policy is a browser concept and has no effect here.
signal?null | AbortSignalHonored — an AbortSignal that aborts the in-flight request when triggered.
window?nullIgnored on Switch — there is no Window to disassociate from. Kept only for spec compatibility.

On this page