对于传出的 HTTP 请求(使用meteor.http.call),我可以定义参数和/或数据。然后可以使用结果(通过 results.content)。
如何访问和解析传入 HTTP 请求的正文/内容/数据?
使用铁路由器,我已经做到了:
Router.map(function () {
this.route('httpTest', {
path: '/httpTest',
action: function () {
var request = this.request;
var response = this.response;
console.log('request_body: '+ request.body);
// request.body does not work. what should it be????
注意我知道我可以访问查询参数,但我想从传入的 http 请求的正文中访问表单数据和/或 json 数据。