本文介绍了无法验证叶签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用node.js request.js来访问api。我收到此错误
I'm using node.js request.js to reach an api. I'm getting this error
我的所有凭证都是准确有效的,服务器也没问题。我和邮递员提出了同样的要求。
All of my credentials are accurate and valid, and the server's fine. I made the same request with postman.
request({
"url": domain+"/api/orders/originator/"+id,
"method": "GET",
"headers":{
"X-API-VERSION": 1,
"X-API-KEY": key
},
}, function(err, response, body){
console.log(err);
console.log(response);
console.log(body);
});
此代码只是在可执行脚本ex中运行。 node ./run_file.js
,这是为什么?是否需要在服务器上运行?
This code is just running in an executable script ex. node ./run_file.js
, Is that why? Does it need to run on a server?
推荐答案
注意:以下是危险的,并且会允许在客户端和服务器之间拦截和修改API内容。
Note: the following is dangerous, and will allow API content to be intercepted and modified between the client and the server.
这也有效
process.env ['NODE_TLS_REJECT_UNAUTHORIZED'] ='0 ';
这篇关于无法验证叶签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!