【发布时间】:2018-03-18 01:24:13
【问题描述】:
我有以下模型,它应该使用来自 post API 的消息:
'use strict';
module.exports = function (Message) {
Message.hl7_message = function (cb) {
cb(null, 'Success... ');
}
Message.remoteMethod(
'hl7_message', {
http: {
path: '/hl7_message',
verb: 'post',
status: 200,
errorStatus: 400
},
accepts: [],
returns: {
arg: 'status',
type: 'string'
}
}
);
};
但是,发布的数据没有预定义的参数,而是作为原始正文提供,内容类型为:应用程序/JSON 格式。
如何配置我的 hl7_message 后消费者以获取发布值的正文? 例如 req.body
【问题讨论】:
标签: node.js loopbackjs loopback