How to Make API Requests with Request-Promise in Node.js

Опубликовано: 28 Январь 2021
на канале: Hey Node
4,284
58

See the written version of this tutorial for links to prerequisites and related tutorials:
https://heynode.com/tutorial/how-make...

One task you’ll encounter often in Node.js is making HTTP requests to an external API from a server. Request-promise, a Promise-based wrapper for the popular request library, helps us do just that. This in-depth reference tutorial shows you how to use an NPM package called request-promise, which is an extended version of the request library with added Promise support.

By the end of this tutorial, you should be able to:

Learn how to install request-promise from NPM
Make GET, POST, PUT, PATCH, and DELETE calls to external APIs using request-promise
Configure your requests with headers, query-strings, bodies, and more options
Understand how to handle errors when making HTTP requests using request-promise

Heynode.com: The best online Node.js courses and tutorials to help you solve hard problems fast.