fetchHelper
Overview
Fetches a URL and returns the response.
Signature
fetchHelper(url, options, messagePrefix, ErrorClass, emptyResponseCodes, emptyResponseValue, errorResolver)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | yes | The URL to fetch. |
| options | any | no | The fetch options. |
| messagePrefix | string | yes | The error message prefix. |
| ErrorClass | FetchError | no | The error class to throw. |
| emptyResponseCodes | Set | no | The response codes that are considered empty. |
| emptyResponseValue | any | no | The value to return if the response is empty. |
| errorResolver | (response: Response, data: any) => Error | no | Custom error factory; defaults to constructing ErrorClass. |
Returns
any
The response data.
Source
client/lib/utils/fetchSupport.js:112