This Fetch API interface represents the response to a request.

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

层级 (查看完整内容)

属性

body: null | ReadableStream<Uint8Array>
bodyUsed: boolean
headers: Headers
ok: boolean
redirected: boolean
status: number
statusText: string
url: string

方法

  • 返回 Promise<ArrayBuffer>

  • 返回 Promise<any>

  • 返回 Promise<string>