vinod vinod - 1 year ago 74
Node.js Question

Steps to send a https request to a rest service in Node js

What are the steps to send a https request in node js to a rest service?
I have an api exposed like

How to pass the request and what are the options I need to give for this API like
host, port, path and method?

Answer Source

The easiest way is to use the request module.

request('', function (error, response, body) {
  if (!error && response.statusCode == 200) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download