2.0.0 • Published 9 months ago
fetch-ext v2.0.0
fetch() extension
Extension of native fetch with:
- Retryable requests
- Request timeout
- Standalone HTTP utilities
options.extension
timeoutnumber | stringRequest timeout
retryObjectlimitnumberDefault: 1
methodsstring[] | falseDefault: DELETE, GET, HEAD, PATCH, PUT
delaynumber | string | resolverDefault: 100
jsonanyShortcut 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