【发布时间】:2014-01-20 23:36:42
【问题描述】:
我无法使用 restify 向我的 node.js API 发送 url 编码的帖子。我的 restify 应用程序有以下设置:
app.use(restify.acceptParser(app.acceptable));
app.use(restify.queryParser());
app.use(restify.urlEncodedBodyParser());
但是当我通过以下请求使用 curl 请求我的应用程序时:
curl -X POST -H "Content-type: application/x-www-form-urlencoded" -d quantity=50 http://app:5000/feeds
我在我的视图中得到以下输入正文:
console.log(req.body) // "quantity=50"
提前致谢,
马蒂亚斯
【问题讨论】:
标签: node.js httprequest restify