Error: request entity too large

后端 未结 21 3668
无人共我
无人共我 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:04

    I don't think this is the express global size limit, but specifically the connect.json middleware limit. This is 100kb by default when you use express.bodyParser() and don't provide a limit option.

    Try:

    app.post('/api/0.1/people', express.bodyParser({limit: '5mb'}), yourHandler);
    

提交回复
热议问题