【发布时间】:2012-09-17 06:03:25
【问题描述】:
我正在做一个节点项目。在下面的中间件 sn-p 中,我需要从 req.body 中删除换行符,以准备在 JSONP 响应中发送。
server.use(function(req,res,next){
if(req.query.concat) {
req.body = req.body; // <--- HERE I need to remove the newlines, etc.
} else {
req.body = req.body || {};
req.body.jsonp_callback = req.query.callback;
}
next();
})
如何让 req.body 为 JSONP 做好准备?
【问题讨论】:
标签: javascript node.js express