Response
This Fetch API interface represents the response to a request.
class Response implements Body {}readonly bodyUsed: boolean;readonly ok: boolean;readonly redirected: boolean;readonly status: number;readonly statusText: string;readonly url: string;arrayBuffer(): Promise<ArrayBuffer>;blob(): Promise<Blob>;clone(): Response;formData(): Promise<FormData>;json(): Promise<any>;text(): Promise<string>;
Implements
Constructors
new Response(body?: BodyInit | null, init?: ResponseInit)Properties
body: ReadableStream<Uint8Array> | null
A simple getter used to expose a ReadableStream of the body contents.
bodyUsed: boolean
Stores a Boolean that declares whether the body has been used in a response yet.
headers: Headersok: booleanredirected: booleanstatus: numberstatusText: stringtrailer: Promise<Headers>type: ResponseTypeurl: stringMethods
arrayBuffer(): Promise<ArrayBuffer>
Takes a Response stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer.
blob(): Promise<Blob>
Takes a Response stream and reads it to completion. It returns a promise that resolves with a Blob.
clone(): ResponseformData(): Promise<FormData>
Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object.
json(): Promise<any>
Takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON.
text(): Promise<string>
Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text).
Static Methods
error(): Responsejson(data: unknown, init?: ResponseInit): Response
© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Response