nx.js
Classes

Request

Extends

  • Body

Implements

Constructors

new Request()

new Request(input, init): Request

Parameters

ParameterType
inputstring | URL | Request
initRequestInit

Returns

Request

Overrides

Body.constructor

Properties

PropertyTypeDescriptionInherited from
bodynull | ReadableStream<Uint8Array>MDN ReferenceglobalThis.Request.body Body.body
bodyUsedbooleanMDN ReferenceglobalThis.Request.bodyUsed Body.bodyUsed
cacheRequestCacheReturns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. MDN Reference-
credentialsRequestCredentialsReturns 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. MDN Reference-
destinationRequestDestinationReturns the kind of resource requested by request, e.g., "document" or "script". MDN Reference-
headersHeaders-globalThis.Request.headers Body.headers
integritystringReturns 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] MDN Reference-
keepalivebooleanReturns a boolean indicating whether or not request can outlive the global in which it was created.-
methodstringReturns request's HTTP method, which is "GET" by default. MDN Reference-
modeRequestModeReturns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. MDN Reference-
redirectRequestRedirectReturns 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. MDN Reference-
referrerstringReturns 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. MDN Reference-
referrerPolicyReferrerPolicyReturns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. MDN Reference-
signalAbortSignalReturns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. MDN Reference-
urlstringReturns the URL of request as a string. MDN Reference-

Methods

arrayBuffer()

arrayBuffer(): Promise<ArrayBuffer>

Returns a promise that resolves with an ArrayBuffer representation of the body. If the body is null, it returns an empty ArrayBuffer.

Returns

Promise<ArrayBuffer>

Implementation of

globalThis.Request.arrayBuffer

Inherited from

Body.arrayBuffer


blob()

blob(): Promise<Blob>

Returns a promise that resolves with a Blob representation of the body. The Blob's type will be the value of the 'content-type' header.

Returns

Promise<Blob>

Implementation of

globalThis.Request.blob

Inherited from

Body.blob


clone()

clone(): Request

MDN Reference

Returns

Request

Implementation of

globalThis.Request.clone


formData()

formData(): Promise<FormData>

Returns a promise that resolves with a FormData representation of the body. If the body cannot be decoded as form data, it throws a TypeError.

Returns

Promise<FormData>

Implementation of

globalThis.Request.formData

Inherited from

Body.formData


json()

json(): Promise<any>

Returns a promise that resolves with a JSON representation of the body. If the body cannot be parsed as JSON, it throws a SyntaxError.

Returns

Promise<any>

Implementation of

globalThis.Request.json

Inherited from

Body.json


text()

text(): Promise<string>

Returns a promise that resolves with a text representation of the body.

Returns

Promise<string>

Implementation of

globalThis.Request.text

Inherited from

Body.text

On this page