nodejs express项目中如何同时获取raw body和解析好的body

    app.use(bodyParser.json({
        verify: function (req, res, buf, encoding) {
            req.rawBody = buf;
        }
    }));
    app.use(bodyParser.urlencoded({
        extended: false,
        verify: function (req, res, buf, encoding) {
            req.rawBody = buf;
        }
    }));

文章来自:http://www.cnblogs.com/mariostudio/p/4709684.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3