0

I am new to both nodejs and loopback. and I want to make a post request. its working fine when connecting to our dev api. But when connecting to our production api, with https. its seems to be getting blocked.

var request = require('request');

request.post({
    url: "",//removed for obvious reasons
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
        myfield: "myfieldvalue"
    }
},function (response, err, body){
    console.log('Body:',JSON.parse(body));
}.bind(this));

1 Answers1

0
rejectUnauthorized: false,//add when working with https sites
requestCert: false,//add when working with https sites
agent: false,//add when working with https sites

I got it working. found the solution in here.