Tuesday, March 31, 2026

HTTP / fetch from node.js

How to make an HTTP request in Node.js

...using the request package (now deprecated) to make HTTP requests in Node.js.
Then promises became mainstream and I switched to request-promise (also deprecated).
In more recent times I moved to axios and I thought I would never look back… and yet here we are.
The HTTP story in Node.js keeps evolving, and for good reasons!

Making HTTP requests is one of the most common tasks in Node.js development.
Whether you’re calling a REST API, fetching data from an external service, or building a web scraper, you need to know how to do it effectively.

Quick Answer: Use fetch()