Class: RoboResponse
Extends the Web Response API with additional convenience methods.
Extends
Response
Constructors
new RoboResponse()
new RoboResponse(body?, init?): RoboResponse
Parameters
Parameter | Type |
---|---|
body ? | BodyInit |
init ? | ResponseInit |
Returns
Overrides
Response.constructor
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
body | readonly | ReadableStream <Uint8Array > | MDN Reference | Response.body |
bodyUsed | readonly | boolean | MDN Reference | Response.bodyUsed |
headers | readonly | Headers | MDN Reference | Response.headers |
ok | readonly | boolean | MDN Reference | Response.ok |
redirected | readonly | boolean | MDN Reference | Response.redirected |
status | readonly | number | MDN Reference | Response.status |
statusText | readonly | string | MDN Reference | Response.statusText |
type | readonly | ResponseType | MDN Reference | Response.type |
url | readonly | string | MDN Reference | Response.url |
Methods
arrayBuffer()
arrayBuffer(): Promise<ArrayBuffer>
Returns
Promise
<ArrayBuffer
>
Inherited from
Response.arrayBuffer
blob()
blob(): Promise<Blob>
Returns
Promise
<Blob
>
Inherited from
Response.blob
clone()
clone(): Response
Returns
Response
Inherited from
Response.clone
formData()
formData(): Promise<FormData>
Returns
Promise
<FormData
>
Inherited from
Response.formData
json()
json(): Promise<any>
Returns
Promise
<any
>
Inherited from
Response.json
text()
text(): Promise<string>
Returns
Promise
<string
>
Inherited from
Response.text
error()
static error(): Response
Returns
Response
Inherited from
Response.error
json()
static json<JsonBody>(body, init?): RoboResponse
Type Parameters
Type Parameter |
---|
JsonBody |
Parameters
Parameter | Type |
---|---|
body | JsonBody |
init ? | ResponseInit |
Returns
Overrides
Response.json
redirect()
static redirect(url, status?): Response
Parameters
Parameter | Type |
---|---|
url | string | URL |
status ? | number |
Returns
Response
Inherited from
Response.redirect