Response
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:195
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Response(body?, init?): Response;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:196
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
body? | BodyInit |
init? | ResponseInit |
Returns
Section titled “Returns”Response
Overrides
Section titled “Overrides”Properties
Section titled “Properties”arrayBuffer()
Section titled “arrayBuffer()”readonly arrayBuffer: () => Promise<ArrayBuffer>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:34
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”blob()
Section titled “blob()”readonly blob: () => Promise<Blob>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:35
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”readonly body: | null| ReadableStream<any>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:31
Inherited from
Section titled “Inherited from”bodyUsed
Section titled “bodyUsed”readonly bodyUsed: boolean;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:32
Inherited from
Section titled “Inherited from”bytes()
Section titled “bytes()”readonly bytes: () => Promise<Uint8Array<ArrayBufferLike>>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:36
Returns
Section titled “Returns”Promise
<Uint8Array
<ArrayBufferLike
>>
Inherited from
Section titled “Inherited from”clone()
Section titled “clone()”readonly clone: () => Response;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:206
Returns
Section titled “Returns”Response
formData()
Section titled “formData()”readonly formData: () => Promise<FormData>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:54
Returns
Section titled “Returns”Example
Section titled “Example”import { Busboy } from '@fastify/busboy'import { Readable } from 'node:stream'
const response = await fetch('...')const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
// handle events emitted from `busboy`
Readable.fromWeb(response.body).pipe(busboy)
Inherited from
Section titled “Inherited from”headers
Section titled “headers”readonly headers: Headers;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:198
json()
Section titled “json()”readonly json: () => Promise<unknown>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:55
Returns
Section titled “Returns”Promise
<unknown
>
Inherited from
Section titled “Inherited from”readonly ok: boolean;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:199
redirected
Section titled “redirected”readonly redirected: boolean;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:204
status
Section titled “status”readonly status: number;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:200
statusText
Section titled “statusText”readonly statusText: string;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:201
text()
Section titled “text()”readonly text: () => Promise<string>;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:56
Returns
Section titled “Returns”Promise
<string
>
Inherited from
Section titled “Inherited from”readonly type: ResponseType;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:202
readonly url: string;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:203
Methods
Section titled “Methods”error()
Section titled “error()”static error(): Response;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:208
Returns
Section titled “Returns”Response
json()
Section titled “json()”static json(data, init?): Response;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:209
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
data | any |
init? | ResponseInit |
Returns
Section titled “Returns”Response
redirect()
Section titled “redirect()”static redirect(url, status): Response;
Defined in: node_modules/.pnpm/undici-types@7.13.0/node_modules/undici-types/fetch.d.ts:210
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
url | string | URL |
status | ResponseRedirectStatus |
Returns
Section titled “Returns”Response