如何在Node.js中处理multipart / mixed?

时间:2020-05-06 13:17:17

标签: node.js middleware multipart-mixed-replace

我一直试图在nodejs中读取多部分/混合数据。

我尝试使用bodyparserbusboy-connect和其他几个模块,但似乎没有任何东西可以将这些数据解析为req.body

因此,如果有人对如何实现此方法有任何想法,请在下面留下答案。 谢谢。

1 个答案:

答案 0 :(得分:0)

app.use(myMiddleware);
 function myMiddleware(req, res, next) {
     req.rawBody = req.body;
     if (req.headers["content-type"] === "multipart/mixed") {
         req.body = req.body;
     }
     next();
}
相关问题