Rate this page:
Forge Fetch API is a partial implementation of node-fetch, which fetches data from an HTTP server.
Import the Forge API package in your app, as follows:
1
import { fetch } from '@forge/api';
To check the status of a request, use status
as shown below:
1 2 3 4
const result = await api.fetch(
"https://example.net/"
)
const status = await result.status
See the Options section of the node-fetch documentation on GitHub for full implementation details.
1
fetch(url[, options]) => Promise<Response>
Name | Type | Description |
---|---|---|
url | string | The URL to request data from. |
options | object | See the node-fetch library’s Options documentation for the accepted values. Defaults are the same as node-fetch. |
Rate this page: