fetch-ext
v1.1.0
Published
fetch() extension
Downloads
206
Readme
fetch() extension
Extension of native fetch with:
- Retryable requests
- Request timeout
- Standalone HTTP utilities
options.extension
timeout
number | stringRequest timeout
retry
Objectlimit
numberDefault: 1
methods
string[] | falseDefault: [DELETE, GET, HEAD, PATCH, PUT]
delay
number | string | resolverDefault: 100
json
anyShortcut for sending JSON serialized data. Equivalent to:
{ headers: { 'content-type': 'application/json', 'accept': 'application/json', }, body: JSON.stringify(value), }
response.extension
body()
Infer and execute body parser based on
content-type