Skip to content

Commit 7e796c8

Browse files
authored
Update 16/umbraco-cms/customizing/foundation/fetching-data/fetch-api.md
1 parent ebae84f commit 7e796c8

File tree

1 file changed

+7
-1
lines changed
  • 16/umbraco-cms/customizing/foundation/fetching-data

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ The Fetch API is a great way to make network requests in Umbraco because it prov
1313

1414
### Example
1515

16-
For this example, we are using the Fetch API to make a GET request to the `/umbraco/MyApiController/GetData` endpoint. The response is then parsed as JSON and logged to the console. If there is an error with the request, it is caught and logged to the console:
16+
For this example, we are using the Fetch API to make a GET request to the `/umbraco/MyApiController/GetData` endpoint. The response is then parsed as JSON and logged to the console.
17+
18+
{% hint style="info" %}
19+
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.
20+
{% endhint %}
21+
22+
If there is an error with the request, it is caught and logged to the console:
1723

1824
```javascript
1925
const data = await fetch('/umbraco/MyApiController/GetData')

0 commit comments

Comments
 (0)