This Fetch API interface represents a resource request.

MDN Reference

interface Request {
    body: ReadableStream<Uint8Array>;
    Body: string;
    bodyUsed: boolean;
    cache: RequestCache;
    ClientIpAddress: string;
    credentials: RequestCredentials;
    Customer: Customer;
    destination: RequestDestination;
    Files: FileInstance[];
    Form: Object;
    headers: Headers;
    Headers: Object;
    Impersonator: Customer;
    integrity: string;
    keepalive: boolean;
    method: string;
    Method: string;
    mode: RequestMode;
    Query: Object;
    redirect: RequestRedirect;
    referrer: string;
    referrerPolicy: ReferrerPolicy;
    signal: AbortSignal;
    url: string;
    arrayBuffer(): Promise<ArrayBuffer>;
    blob(): Promise<Blob>;
    clone(): Request;
    formData(): Promise<FormData>;
    json(): Promise<any>;
    text(): Promise<string>;
}

Hierarchy

  • Body
  • _Request
    • Request

Properties

body: ReadableStream<Uint8Array>
Body: string

Body content of the request.

bodyUsed: boolean
cache: RequestCache

Returns 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

ClientIpAddress: string

Client's IP address making the request.

credentials: RequestCredentials

Returns 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

Customer: Customer

Customer associated with the request.

destination: RequestDestination

Returns the kind of resource requested by request, e.g., "document" or "script".

MDN Reference

Files: FileInstance[]

Files uploaded as part of the request.

Form: Object

Form data associated with the request.

headers: Headers

Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the "Host" header.

MDN Reference

Headers: Object

Headers of the request.

Impersonator: Customer

Customer impersonator if available.

integrity: string

Returns 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

keepalive: boolean

Returns a boolean indicating whether or not request can outlive the global in which it was created.

method: string

Returns request's HTTP method, which is "GET" by default.

MDN Reference

Method: string

The HTTP method of the request.

mode: RequestMode

Returns 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

Query: Object

Query parameters associated with the request.

redirect: RequestRedirect

Returns 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

referrer: string

Returns 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

referrerPolicy: ReferrerPolicy

Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.

MDN Reference

signal: AbortSignal

Returns 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

url: string

Returns the URL of request as a string.

MDN Reference

Methods

  • Returns Promise<ArrayBuffer>

  • Returns Promise<Blob>

  • Returns Promise<FormData>

  • Returns Promise<any>

  • Returns Promise<string>