Async events API
Fetch API
Storage API

Rate this page:

Fetch API

Forge Fetch API is a partial implementation of node-fetch, which fetches data from an HTTP server. In the most basic use, fetch is a simple HTTP client. However, fetch also supports multiple options for managed authentication to remote APIs.

Basic

The basic client provides a simple HTTP client. Import the Forge API package in your app, as follows:

1
2
import { fetch } from '@forge/api';

To check the status of a request, use status as shown below:

1
2
const result = await fetch(
  "https://example.net/"
);
const status = result.status;

See the Options section of the node-fetch documentation on GitHub for full implementation details.

Method signature

1
2
fetch(url[, options]) => Promise<Response>

Parameters

Rate this page: