【发布时间】:2016-10-06 04:34:19
【问题描述】:
我正在使用 api 做一些工作,我需要向我的解析服务器发出一个 post 请求,但我收到错误 error:{unauthorized access},我很确定这是因为密钥,但我不确定。我正在使用邮递员查看是否可以向 app.post 函数发出请求,但出现上述错误。我正在向`https://xxxxxxxx.herokuapp.com/parse/index/testing提出请求
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
app.get('/', function(req, res) {
res.status(200).send('I dream of being a website. Please star the parse- server repo on GitHub!');
});
app.post('/testing', twilio.webhook({ validate: false }), headers: {"AppId": "", "MasterKey": ""}, function (req, res) {
console.log("testing")
});
Heroku 日志
at=info method=POST path="/parse/index/testing" host=xxxxxxx.herokuapp.com request_id=..... fwd="xx.xxx.xxx.xxx" dyno=web.1 connect=1ms service=41ms status=403 bytes=506
【问题讨论】:
-
你能运行
heroku logs看看发生了什么 -
@abdulbarik 我更新了我的问题以包含日志
-
statusCode=403: 你没有权限访问这个资源 -
是的,这就是我的想法,但是如何将密钥附加到请求中?
-
意思是你想在这条路线上附加
app.post('/testing')?
标签: node.js http-post httprequest parse-server