Implements
Iterable
<[string
,string
]>
Accessors
body
null
if there was no body.
Returns
null
| Readonly
<Uint8Array
>
Source
utils/fetch.ts:891bodyJson
Returns
any
Source
utils/fetch.ts:916bodyText
""
) if there was no body.
An error is thrown if the body is invalid UTF-8 data.
Returns
string
Source
utils/fetch.ts:900headers
Returns
Record
<string
, string
>
Source
utils/fetch.ts:884request
Returns
null
| FetchRequest
Source
utils/fetch.ts:1033statusCode
Returns
number
Source
utils/fetch.ts:870statusMessage
Returns
string
Source
utils/fetch.ts:877Methods
assertOk()
SERVER_ERROR
if this response is not ok.
Returns
void
Throws
If the response is not ok.Source
utils/fetch.ts:1049getHeader()
key
, ignoring case.
Parameters
Parameter | Type | Description |
---|---|---|
key | string | The header key to retrieve. |
Returns
string
The header value.
Source
utils/fetch.ts:1016hasBody()
Returns
this is FetchResponse & Object
True if the response has a body.
Throws
If the body is invalid UTF-8 data.Source
utils/fetch.ts:1026makeServerError()
message
with an
optional error
.
Parameters
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
error ? | Error | The error to use. |
Returns
FetchResponse
The error response.
Source
utils/fetch.ts:975ok()
Returns
boolean
Source
utils/fetch.ts:1040throwThrottleError()
stall
milliseconds.
Parameters
Parameter | Type | Description |
---|---|---|
message ? | string | The error message to use. |
stall ? | number | The number of milliseconds to stall before retrying. |
Returns
never
Throws
Ifstall
is not a non-negative integer.