跳到主要内容
CNode

nestjs post请求提交数据量太大会报错 [ExceptionsHandler] request entity too large

问答
GGuiLingWN发布于 6 年前最后回复 6 年前
561920

image.png nestjs文档没有找到 设置请求body大小 的相关配置,看了下 express 可以引入bodyParser配置解决 有没有老哥遇到过类似问题,相关配置是什么?

查看回复

回复 (5)

G
GuiLingWN#56 年前
引用 helloyou2012学会看文档,学会利用搜索引擎: 搜索引擎关键字:nestjs request entity too large

@helloyou2012 该找的都找了,只是没找到nestjs相关的,试了下直接引入bodyParser解决了

G
ganshiqingyuan#46 年前

默认是express的大小

G
GuiLingWN#36 年前
引用 jiangli373

@jiangli373 可以了,多谢

H
helloyou2012#26 年前

学会看文档,学会利用搜索引擎: 搜索引擎关键字:nestjs request entity too large

J
jiangli373#16 年前
import * as bodyParser from 'body-parser';
async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.use(bodyParser.json({limit: '50mb'}));
  app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
  await app.listen(3000);
}
bootstrap();

参与回复

登录后即可参与回复。登录