Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我开发了环回 API,并且在一个名为“支付”的模型中,必须监听来自另一个 Web 应用程序的 xml 帖子。我试图在支付模型上制作模型挂钩以接收 xml 帖子,但我很困惑如何接受已在我的模型挂钩中发送的 xml 文件?
LoopBack 目前还没有内置的 XML 解析。但是您可以使用快速路由或中间件来处理请求,例如:
app.use('/my-xml-middleware', function(req, res, next) { // transform xml to json next(); });
或者:
app.post('/my-xml-service', function(req, res, next) { // process xml res.send(...); });