只需添加以下行:
rejectUnauthorized: false,//add when working with https sites requestCert: false,//add when working with https sites agent: false,//add when working with https sites
因此,您的代码如下所示:
var request = require('request');request.post({ url: "",//your url headers: { 'Content-Type': 'application/x-www-form-urlenpred' }, 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));


