Skip to content

fetchHelper ​

Overview ​

Fetches a URL and returns the response.

Signature ​

fetchHelper(url, options, messagePrefix, ErrorClass, emptyResponseCodes, emptyResponseValue, errorResolver)

Parameters ​

NameTypeRequiredDescription
urlstringyesThe URL to fetch.
optionsanynoThe fetch options.
messagePrefixstringyesThe error message prefix.
ErrorClassFetchErrornoThe error class to throw.
emptyResponseCodesSetnoThe response codes that are considered empty.
emptyResponseValueanynoThe value to return if the response is empty.
errorResolver(response: Response, data: any) => ErrornoCustom error factory; defaults to constructing ErrorClass.

Returns ​

any

The response data.

Source ​

client/lib/utils/fetchSupport.js:112