我一直试图在nodejs中读取多部分/混合数据。
我已经尝试过使用bodyparser
,busboy-connect
和其他几个模块,但似乎没有任何东西可以将此数据解析为req.body
。
因此,如果有人对如何实施此方法有任何想法,请在下面留下答案。谢谢。
app.use(myMiddleware);
function myMiddleware(req, res, next) {
req.rawBody = req.body;
if (req.headers["content-type"] === "multipart/mixed") {
req.body = req.body;
}
next();
}