如何禁用SSL验证nodejs Loopback Request Plugin
How to disable SSL verification nodejs Loopback Request Plugin
我对 nodejs 和环回都是新手。我想提出 post 请求。它在连接到我们的开发 api 时工作正常。但是当使用 https 连接到我们的产品时 api。它似乎被阻止了。
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));
rejectUnauthorized: false,//add when working with https sites
requestCert: false,//add when working with https sites
agent: false,//add when working with https sites
我成功了。在 .
中找到了解决方案
我对 nodejs 和环回都是新手。我想提出 post 请求。它在连接到我们的开发 api 时工作正常。但是当使用 https 连接到我们的产品时 api。它似乎被阻止了。
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));
rejectUnauthorized: false,//add when working with https sites
requestCert: false,//add when working with https sites
agent: false,//add when working with https sites
我成功了。在