The request module is used to make HTTP calls. It is the simplest way of making HTTP calls in node.js using this request module. It follows redirects by default.
Feature of Request module:
- It is easy to get started and easy to use.
- It is widely used and popular module for making HTTP calls.
Installation of request module:
- You can visit the link Install Request module. You can install this package by using this command.
npm install request
- After installing request module you can check your request version in command prompt using the command.
npm version request
- After that, you can create a folder and add a file for example index.js, To run this file you need to run the following command.
Steps to run the program:
- The project structure will look like this:
- Make sure you have install express and request module using following commands:
npm install request
npm install express
- Run index.js file using below command:
So this is how you can use the request module for making HTTP calls. It is very simple and easy to use.
- Nodejs | Automatic restart NodeJs server with nodemon
- How to send a GET request from PHP?
- Express.js | app.get() Request Function
- Simple POST request using the fetch API
- Node.js | https.request() Function
- HTTP headers | Access-Control-Request-Method
- Nodejs | DNS
- Nodejs | Jimp
- Web-Socket in NodeJS
- Nodejs | DNS | setServers()
- HTTP headers | Access-Control-Request-Headers
- Nodejs | GM blur() Function
- Nodejs | GM despeckle() Function
- Nodejs | GM sharpen() Function
- Nodejs | GM shave() Function
- Encrypting Data in NodeJS
- Nodejs | GM crop() Function
- Nodejs | GM gamma() Function
- Nodejs | GM charcoal() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.