Just add this lines:
rejectUnauthorized: false,//add when working with https sites
requestCert: false,//add when working with https sites
agent: false,//add when working with https sites
So your code would look like this:
var request = require('request');
request.post({
url: "",//your url
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
rejectUnauthorized: false,//add when working with https sites
requestCert: false,//add when working with https sites
agent: false,//add when working with https sites
form: {
myfield: "myfieldvalue"
}
},function (response, err, body){
console.log('Body:',JSON.parse(body));
}.bind(this));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…