SongGuess
    Preparing search index...

    Interface Request<CfHostMetadata, Cf>

    The Request interface of the Fetch API represents a resource request.

    MDN Reference

    interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> {
        body: ReadableStream<Uint8Array<ArrayBuffer>> | null;
        bodyUsed: boolean;
        cache?: RequestCache;
        cf?: Cf;
        credentials: RequestCredentials;
        destination: RequestDestination;
        fetcher:
            | {
                connect(
                    address: string | SocketAddress,
                    options?: SocketOptions,
                ): Socket;
                fetch(
                    input: URL | RequestInfo,
                    init?: RequestInit<CfProperties<unknown>>,
                ): Promise<Response>;
            }
            | null;
        headers: Headers;
        integrity: string;
        keepalive: boolean;
        method: string;
        mode: RequestMode;
        redirect: RequestRedirect;
        referrer: string;
        referrerPolicy: ReferrerPolicy;
        signal: AbortSignal;
        url: string;
        arrayBuffer(): Promise<ArrayBuffer>;
        arrayBuffer(): Promise<ArrayBuffer>;
        blob(): Promise<Blob>;
        blob(): Promise<Blob>;
        bytes(): Promise<Uint8Array<ArrayBuffer>>;
        bytes(): Promise<Uint8Array<ArrayBufferLike>>;
        clone(): Request;
        clone(): Request<CfHostMetadata, Cf>;
        formData(): Promise<FormData>;
        formData(): Promise<FormData>;
        json(): Promise<any>;
        json<T>(): Promise<T>;
        text(): Promise<string>;
        text(): Promise<string>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    body: ReadableStream<Uint8Array<ArrayBuffer>> | null
    bodyUsed: boolean
    cache?: RequestCache

    The cache read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.

    MDN Reference

    cf?: Cf
    credentials: RequestCredentials

    The credentials read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected.

    MDN Reference

    destination: RequestDestination

    The destination read-only property of the Request interface returns a string describing the type of content being requested.

    MDN Reference

    fetcher:
        | {
            connect(
                address: string | SocketAddress,
                options?: SocketOptions,
            ): Socket;
            fetch(
                input: URL | RequestInfo,
                init?: RequestInit<CfProperties<unknown>>,
            ): Promise<Response>;
        }
        | null
    headers: Headers

    The headers read-only property of the Request interface contains the Headers object associated with the request.

    MDN Reference

    integrity: string

    The integrity read-only property of the Request interface contains the subresource integrity value of the request.

    MDN Reference

    keepalive: boolean

    The keepalive read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.

    MDN Reference

    method: string

    The method read-only property of the Request interface contains the request's method (GET, POST, etc.)

    MDN Reference

    mode: RequestMode

    The mode read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable.

    MDN Reference

    redirect: RequestRedirect

    The redirect read-only property of the Request interface contains the mode for how redirects are handled.

    MDN Reference

    referrer: string

    The referrer read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.)

    MDN Reference

    referrerPolicy: ReferrerPolicy

    The referrerPolicy read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request.

    MDN Reference

    signal: AbortSignal

    The read-only signal property of the Request interface returns the AbortSignal associated with the request.

    MDN Reference

    url: string

    The url read-only property of the Request interface contains the URL of the request.

    MDN Reference

    Methods

    • Returns Promise<ArrayBuffer>

    • Returns Promise<ArrayBuffer>

    • Returns Promise<Blob>

    • Returns Promise<Blob>

    • Returns Promise<Uint8Array<ArrayBuffer>>

    • Returns Promise<Uint8Array<ArrayBufferLike>>

    • Returns Promise<FormData>

    • Returns Promise<FormData>

    • Returns Promise<any>

    • Type Parameters

      • T

      Returns Promise<T>

    • Returns Promise<string>

    • Returns Promise<string>