Skip to content

Node.js 报错:PayloadTooLargeError: request entity too large

Published: at 10:33 AMSuggest Changes

问题

接口报错 PayloadTooLargeError: request entity too large

问题解决方案

app.use(express.json({ limit: '50mb' }));
app.use(express.urlencoded({ limit: '50mb', extended: true }));

如果用了 body-parser

var bodyParser = require('body-parser');
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

参考链接


Previous Post
JS 点击事件监听失效问题及解决
Next Post
前端 CORS 跨域问题详解