The response for a FetchRequest.
Iterable
<[string
, string
]>The response body, or null
if there was no body.
null
| Readonly
<Uint8Array
>
The response body, decoded as JSON.
An error is thrown if the body is invalid JSON-encoded data or if there was no body.
any
The response body as a UTF-8 encoded string, or the empty string (i.e. ""
) if there was no body.
An error is thrown if the body is invalid UTF-8 data.
string
The response headers. All keys are lower-case.
Record
<string
, string
>
The request made for this response.
null
| FetchRequest
The response status code.
number
The response status message.
string
Throws a SERVER_ERROR
if this response is not ok.
void
If the response is not ok.
Get the header value for key
, ignoring case.
Parameter | Type | Description |
---|---|---|
key | string | The header key to retrieve. |
string
The header value.
Returns true if the response has a body.
this is FetchResponse & Object
True if the response has a body.
If the body is invalid UTF-8 data.
Return a Response with matching headers and body, but with an error status code (i.e. 599) and message
with an
optional error
.
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
error ? | Error | The error to use. |
The error response.
Returns true if this response was a success statusCode.
boolean
If called within a request.processFunc call, causes the request to retry as if
throttled for stall
milliseconds.
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
stall ? | number | The number of milliseconds to stall before retrying. |
never
If stall
is not a non-negative integer.
The response for a FetchRequest.
Iterable
<[string
, string
]>The response body, or null
if there was no body.
null
| Readonly
<Uint8Array
>
The response body, decoded as JSON.
An error is thrown if the body is invalid JSON-encoded data or if there was no body.
any
The response body as a UTF-8 encoded string, or the empty string (i.e. ""
) if there was no body.
An error is thrown if the body is invalid UTF-8 data.
string
The response headers. All keys are lower-case.
Record
<string
, string
>
The request made for this response.
null
| FetchRequest
The response status code.
number
The response status message.
string
Throws a SERVER_ERROR
if this response is not ok.
void
If the response is not ok.
Get the header value for key
, ignoring case.
Parameter | Type | Description |
---|---|---|
key | string | The header key to retrieve. |
string
The header value.
Returns true if the response has a body.
this is FetchResponse & Object
True if the response has a body.
If the body is invalid UTF-8 data.
Return a Response with matching headers and body, but with an error status code (i.e. 599) and message
with an
optional error
.
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
error ? | Error | The error to use. |
The error response.
Returns true if this response was a success statusCode.
boolean
If called within a request.processFunc call, causes the request to retry as if
throttled for stall
milliseconds.
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
stall ? | number | The number of milliseconds to stall before retrying. |
never
If stall
is not a non-negative integer.