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
Properties
| Property | Type | Description |
|---|---|---|
body? | null | BodyInit | Honored — the request body. May be a BodyInit (string, ArrayBuffer, FormData, URLSearchParams, Blob, or ReadableStream) or null. |
cache? | RequestCache | Ignored 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? | RequestCredentials | Ignored 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? | HeadersInit | Honored — request headers (Headers, an object literal, or an array of [name, value] pairs). |
integrity? | string | Not 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? | boolean | Ignored on Switch. There is no concept of a page lifetime that keepalive would extend a request beyond. |
method? | string | Honored — HTTP method ('GET', 'POST', etc.). Defaults to 'GET'. |
mode? | RequestMode | Ignored 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? | RequestRedirect | Honored — controls how 3xx redirects are handled ('follow' (default), 'error', or 'manual'). |
referrer? | string | Ignored on Switch. No Referer header is set automatically; supply one via headers if needed. |
referrerPolicy? | ReferrerPolicy | Ignored on Switch. Referrer policy is a browser concept and has no effect here. |
signal? | null | AbortSignal | Honored — an AbortSignal that aborts the in-flight request when triggered. |
window? | null | Ignored on Switch — there is no Window to disassociate from. Kept only for spec compatibility. |