Skip to content

Workery / responses / JSONResponse

Class: JSONResponse

responses.JSONResponse

Hierarchy

  • Response

    JSONResponse

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new JSONResponse(body, init?): JSONResponse

Parameters

NameType
bodyany
init?ResponseInit

Returns

JSONResponse

Overrides

Response.constructor

Defined in

src/responses.ts:2

Properties

webSocket

Readonly webSocket: null | WebSocket

Inherited from

Response.webSocket

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1547


cf

Optional Readonly cf: any

Inherited from

Response.cf

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1548


body

Readonly body: null | ReadableStream<Uint8Array>

MDN Reference

Inherited from

Response.body

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3151

node_modules/@cloudflare/workers-types/index.d.ts:1501


bodyUsed

Readonly bodyUsed: boolean

MDN Reference

Inherited from

Response.bodyUsed

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3153

node_modules/@cloudflare/workers-types/index.d.ts:1503


headers

Readonly headers: Headers

MDN Reference

Inherited from

Response.headers

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18936

node_modules/@cloudflare/workers-types/index.d.ts:1540


ok

Readonly ok: boolean

MDN Reference

Inherited from

Response.ok

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18938

node_modules/@cloudflare/workers-types/index.d.ts:1542


redirected

Readonly redirected: boolean

MDN Reference

Inherited from

Response.redirected

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18940

node_modules/@cloudflare/workers-types/index.d.ts:1544


status

Readonly status: number

MDN Reference

Inherited from

Response.status

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18942

node_modules/@cloudflare/workers-types/index.d.ts:1536


statusText

Readonly statusText: string

MDN Reference

Inherited from

Response.statusText

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18944

node_modules/@cloudflare/workers-types/index.d.ts:1538


type

Readonly type: ResponseType

MDN Reference

Inherited from

Response.type

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18946


url

Readonly url: string

MDN Reference

Inherited from

Response.url

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18948

node_modules/@cloudflare/workers-types/index.d.ts:1546

Methods

bytes

bytes(): Promise<Uint8Array>

Returns

Promise<Uint8Array>

Inherited from

Response.bytes

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1506


arrayBuffer

arrayBuffer(): Promise<ArrayBuffer>

MDN Reference

Returns

Promise<ArrayBuffer>

Inherited from

Response.arrayBuffer

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3155

arrayBuffer(): Promise<ArrayBuffer>

Returns

Promise<ArrayBuffer>

Inherited from

Response.arrayBuffer

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1505


blob

blob(): Promise<Blob>

MDN Reference

Returns

Promise<Blob>

Inherited from

Response.blob

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3157

blob(): Promise<Blob>

Returns

Promise<Blob>

Inherited from

Response.blob

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1514


formData

formData(): Promise<FormData>

MDN Reference

Returns

Promise<FormData>

Inherited from

Response.formData

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3159

formData(): Promise<FormData>

Returns

Promise<FormData>

Inherited from

Response.formData

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1512


json

json(): Promise<any>

MDN Reference

Returns

Promise<any>

Inherited from

Response.json

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3161

json<T>(): Promise<T>

Type parameters

Name
T

Returns

Promise<T>

Inherited from

Response.json

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1510


text

text(): Promise<string>

MDN Reference

Returns

Promise<string>

Inherited from

Response.text

Defined in

node_modules/typescript/lib/lib.dom.d.ts:3163

text(): Promise<string>

Returns

Promise<string>

Inherited from

Response.text

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1508


clone

clone(): Response

MDN Reference

Returns

Response

Inherited from

Response.clone

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18950

clone(): Response

Returns

Response

Inherited from

Response.clone

Defined in

node_modules/@cloudflare/workers-types/index.d.ts:1534


error

error(): Response

MDN Reference

Returns

Response

Inherited from

Response.error

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18957


json

json(data, init?): Response

MDN Reference

Parameters

NameType
dataany
init?ResponseInit

Returns

Response

Inherited from

Response.json

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18959


redirect

redirect(url, status?): Response

MDN Reference

Parameters

NameType
urlstring | URL
status?number

Returns

Response

Inherited from

Response.redirect

Defined in

node_modules/typescript/lib/lib.dom.d.ts:18961