Skip to content

Commit d3e6d16

Browse files
committed
docs: adds warning about error handling
1 parent d4a4236 commit d3e6d16

File tree

1 file changed

+4
-0
lines changed
  • 16/umbraco-cms/customizing/foundation/fetching-data

1 file changed

+4
-0
lines changed

16/umbraco-cms/customizing/foundation/fetching-data/fetch-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if (data) {
3636
The example assumes that you have a controller set up at the `/umbraco/MyApiController/GetData` endpoint that returns JSON data. You can replace this with your own endpoint as needed. Read more about creating a controller in the [Controllers](../../../implementation/controllers.md) article.
3737
{% endhint %}
3838

39+
{% hint style="warning" %}
40+
When using the Fetch API, you need to manually handle errors and authentication. For most scenarios, we recommend using the Umbraco HTTP Client, which provides built-in error handling and authentication.
41+
{% endhint %}
42+
3943
## Authentication
4044

4145
When making requests to the Umbraco API controllers, you may need to include an authorization token in the request headers. This is especially important when making requests to endpoints that require authentication.

0 commit comments

Comments
 (0)