SongGuess
    Preparing search index...

    The Response interface of the Fetch API represents the response to a request.

    MDN Reference

    interface Response {
        body: ReadableStream<Uint8Array<ArrayBuffer>> | null;
        bodyUsed: boolean;
        cf: any;
        headers: Headers;
        ok: boolean;
        redirected: boolean;
        status: number;
        statusText: string;
        type: ResponseType;
        url: string;
        webSocket: WebSocket | null;
        arrayBuffer(): Promise<ArrayBuffer>;
        arrayBuffer(): Promise<ArrayBuffer>;
        blob(): Promise<Blob>;
        blob(): Promise<Blob>;
        bytes(): Promise<Uint8Array<ArrayBuffer>>;
        bytes(): Promise<Uint8Array<ArrayBufferLike>>;
        clone(): Response;
        clone(): Response;
        formData(): Promise<FormData>;
        formData(): Promise<FormData>;
        json(): Promise<any>;
        json<T>(): Promise<T>;
        text(): Promise<string>;
        text(): Promise<string>;
    }

    Hierarchy (View Summary)

    • Body
    • _Response
      • Response
    Index

    Properties

    body: ReadableStream<Uint8Array<ArrayBuffer>> | null
    bodyUsed: boolean
    cf: any
    headers: Headers

    The headers read-only property of the Response interface contains the Headers object associated with the response.

    MDN Reference

    ok: boolean

    The ok read-only property of the Response interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.

    MDN Reference

    redirected: boolean

    The redirected read-only property of the Response interface indicates whether or not the response is the result of a request you made which was redirected.

    MDN Reference

    status: number

    The status read-only property of the Response interface contains the HTTP status codes of the response.

    MDN Reference

    statusText: string

    The statusText read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.

    MDN Reference

    type: ResponseType

    The type read-only property of the Response interface contains the type of the response. The type determines whether scripts are able to access the response body and headers.

    MDN Reference

    url: string

    The url read-only property of the Response interface contains the URL of the response. The value of the url property will be the final URL obtained after any redirects.

    MDN Reference

    webSocket: WebSocket | null

    Methods

    • Returns Promise<ArrayBuffer>

    • Returns Promise<ArrayBuffer>

    • Returns Promise<Blob>

    • Returns Promise<Blob>

    • Returns Promise<Uint8Array<ArrayBuffer>>

    • Returns Promise<Uint8Array<ArrayBufferLike>>

    • The clone() method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.

      MDN Reference

      Returns Response

    • The clone() method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.

      MDN Reference

      Returns Response

    • Returns Promise<FormData>

    • Returns Promise<FormData>

    • Returns Promise<any>

    • Type Parameters

      • T

      Returns Promise<T>

    • Returns Promise<string>

    • Returns Promise<string>