Cerces / responses / JSONResponse
Class: JSONResponse
Defined in: src/responses.ts:5
A Response subclass that serializes the response body using JSON.stringify and sets the Content-Type header to application/json
Extends
Response
Constructors
Constructor
new JSONResponse(
body,init?):JSONResponse
Defined in: src/responses.ts:6
Parameters
body
any
init?
ResponseInit
Returns
JSONResponse
Overrides
Response.constructor
Properties
body
readonlybody:null|ReadableStream<Uint8Array<ArrayBuffer>>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4468
Inherited from
Response.body
bodyUsed
readonlybodyUsed:boolean
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4470
Inherited from
Response.bodyUsed
headers
readonlyheaders:Headers
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26322
The headers read-only property of the with the response.
Inherited from
Response.headers
ok
readonlyok:boolean
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26328
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.
Inherited from
Response.ok
redirected
readonlyredirected:boolean
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26334
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.
Inherited from
Response.redirected
status
readonlystatus:number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26340
The status read-only property of the Response interface contains the HTTP status codes of the response.
Inherited from
Response.status
statusText
readonlystatusText:string
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26346
The statusText read-only property of the Response interface contains the status message corresponding to the HTTP status code in Response.status.
Inherited from
Response.statusText
type
readonlytype:ResponseType
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26352
The type read-only property of the Response interface contains the type of the response.
Inherited from
Response.type
url
readonlyurl:string
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26358
The url read-only property of the Response interface contains the URL of the response.
Inherited from
Response.url
Methods
arrayBuffer()
arrayBuffer():
Promise<ArrayBuffer>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4472
Returns
Promise<ArrayBuffer>
Inherited from
Response.arrayBuffer
blob()
blob():
Promise<Blob>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4474
Returns
Promise<Blob>
Inherited from
Response.blob
bytes()
bytes():
Promise<Uint8Array<ArrayBuffer>>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4476
Returns
Promise<Uint8Array<ArrayBuffer>>
Inherited from
Response.bytes
formData()
formData():
Promise<FormData>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4478
Returns
Promise<FormData>
Inherited from
Response.formData
json()
json():
Promise<any>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4480
Returns
Promise<any>
Inherited from
Response.json
text()
text():
Promise<string>
Defined in: node_modules/typescript/lib/lib.dom.d.ts:4482
Returns
Promise<string>
Inherited from
Response.text
clone()
clone():
Response
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26364
The clone() method of the Response interface creates a clone of a response object, identical in every way, but stored in a different variable.
Returns
Response
Inherited from
Response.clone
error()
staticerror():Response
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26375
The error() static method of the Response interface returns a new Response object associated with a network error.
Returns
Response
Inherited from
Response.error
json()
staticjson(data,init?):Response
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26381
The json() static method of the Response interface returns a Response that contains the provided JSON data as body, and a Content-Type header which is set to application/json.
Parameters
data
any
init?
ResponseInit
Returns
Response
Inherited from
Response.json
redirect()
staticredirect(url,status?):Response
Defined in: node_modules/typescript/lib/lib.dom.d.ts:26387
The redirect() static method of the Response interface returns a Response resulting in a redirect to the specified URL.
Parameters
url
string | URL
status?
number
Returns
Response
Inherited from
Response.redirect