The basic fetch client provides a simple HTTP client. Import the Forge API package in your app, as follows:
1 2import { fetch } from '@forge/api';
To check the status of a request, use status as shown below:
1 2const result = await fetch( "https://example.net/" ); const status = result.status;
See the Using the Fetch API with Undici in Node.js section of the undici
documentation for full implementation details.
1 2fetch(url[, options]) => Promise<Response>
| Name | Type | Description |
|---|---|---|
url | string | The URL to request data from. |
options | object | See Using the Fetch API with Undici in Node.js for details about accepted values. |
Rate this page: