Error: request entity too large

后端 未结 21 3119
无人共我
无人共我 2020-11-22 06:36

I\'m receiving the following error with express:

Error: request entity too large
    at module.exports (/Users/michaeljames/Documents/Projects/Proj/mean/node         


        
21条回答
  •  孤街浪徒
    2020-11-22 07:08

    I faced the same issue recently and bellow solution workes for me.

    Dependency : 
    express >> version : 4.17.1
    body-parser >> version": 1.19.0
    
    const express = require('express');
    const bodyParser = require('body-parser');
    
    const app = express(); 
    app.use(bodyParser.json({limit: '50mb'}));
    app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
    

    For understanding : HTTP 431

    The HTTP 413 Payload Too Large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a Retry-After header field.

提交回复
热议问题