---
url: "https://vueda.dev/v3/reference/api/js/utils/fetchSupport/functions/fetchHelper.md"
title: "fetchHelper"
---

# fetchHelper

## Overview

Fetches a URL and returns the response.

## Signature

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

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-url">url</span> | `string` | yes | The URL to fetch. |
| <span id="param-options">options</span> | `any` | no | The fetch options. |
| <span id="param-messagePrefix">messagePrefix</span> | `string` | yes | The error message prefix. |
| <span id="param-ErrorClass">ErrorClass</span> | [FetchError](/v3/reference/api/js/utils/errors/members/FetchError.md) | no | The error class to throw. |
| <span id="param-emptyResponseCodes">emptyResponseCodes</span> | `Set` | no | The response codes that are considered empty. |
| <span id="param-emptyResponseValue">emptyResponseValue</span> | `any` | no | The value to return if the response is empty. |
| <span id="param-errorResolver">errorResolver</span> | `(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`
