Requesting HTTP REST API with Node.js native Fetch API

Presenter: Wasin Waeosri from Refinitiv

Length: 8.49 mins

The Fetch API provides an interface for fetching resources asynchronously across the network using Promise. It is the modern successor of the XMLHttpRequest API for performing asynchronous HTTP requests. The API is supported by most modern web browsers today.  

While the frontend JavaScript web developers have been using the Fetch API since 2015, the API has not been included in the Node.js runtime environment. The backend JavaScript developers need to use the other libraries such as the deprecated request modulepostman-requestAxiosNode Fetch module, etc to make the HTTP request with Promise on the Node server environment.

Introduction in Node version 17.5.0, the native Fetch API is now available as an experimental feature (thanks to Undici). The Node version 18.0.0 also enables this experimental fetch API on the global scope by default. The backend JavaScript developers do not need to install extra fetch-like modules anymore. The front-end developers will be familiar with the server-side HTTP request code in Node.js.

This video shows how to use the Node.js experimental native Fetch API with the Refinitiv Data Platform (RDP) APIs as the example HTTP REST APIs. The application source codes are implemented in the TypeScript language, and then run the application in a controlled environment such as Docker and devcontainer using the Node Docker Image

The full article is available in the following article: