Skip to content

Commit b00b238

Browse files
Update apps/site/pages/en/learn/getting-started/fetch.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ben Halverson <7907232+benhalverson@users.noreply.github.com>
1 parent 2e2b27f commit b00b238

File tree

1 file changed

+1
-2
lines changed
  • apps/site/pages/en/learn/getting-started

1 file changed

+1
-2
lines changed

apps/site/pages/en/learn/getting-started/fetch.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ main().catch(console.error);
6565

6666
Undici allows you to customize the Fetch API by providing options to the `fetch` function. For example, you can set custom headers, set the request method, and set the request body. Here is an example of how you can customize the Fetch API with Undici:
6767

68-
The [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) function takes two arguments: the URL to fetch and an options object. The options object is the [Request](https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-requestoptions) object that you can use to customize the request. The function returns a [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that resolves to a [Response](https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-responsedata) object. Some differences between the Fetch API in the browser and the Fetch API in Node.js is that the Node.js version include the following:
69-
68+
The [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) function takes two arguments: the URL to fetch and an options object. The options object is the [Request](https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-requestoptions) object that you can use to customize the request. The function returns a [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) that resolves to a [Response](https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-responsedata) object. Some differences between the Fetch API in the browser and the Fetch API in Node.js are that the Node.js version includes the following:
7069
- Credentials: Node.js does not support the credentials option because it doesn't handle cookies or sessions as browsers do.
7170
- Caching: The cache option is not supported in Node.js, as there is no built-in cache mechanism comparable to that in a browser.
7271
- Referrer and Referrer Policy: The referrer option is not supported in Node.js because it lacks the concept of a referrer that exists in browser environments.

0 commit comments

Comments
 (0)