PayloadTooLargeError: request entity too large when trying to POST to apostrophe-headless API
See original GitHub issueI am using apostrophe-headless, and my payloads are slightly big since I am storing images as base64 strings, so some of the requests fail with this:
PayloadTooLargeError: request entity too large
at readStream (/Users/marjan/Projects/marketplace-backend/node_modules/raw-body/index.js:155:17)
at getRawBody (/Users/marjan/Projects/marketplace-backend/node_modules/raw-body/index.js:108:12)
at read (/Users/marjan/Projects/marketplace-backend/node_modules/body-parser/lib/read.js:77:3)
at jsonParser (/Users/marjan/Projects/marketplace-backend/node_modules/body-parser/lib/types/json.js:134:5)
at Layer.handle [as handle_request] (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:317:13)
at /Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:335:12)
at next (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:275:10)
at urlencodedParser (/Users/marjan/Projects/marketplace-backend/node_modules/body-parser/lib/types/urlencoded.js:100:7)
at Layer.handle [as handle_request] (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:317:13)
at /Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:335:12)
at next (/Users/marjan/Projects/marketplace-backend/node_modules/express/lib/router/index.js:275:10)
at self.csrf (/Users/marjan/Projects/marketplace-backend/node_modules/apostrophe/lib/modules/apostrophe-express/index.js:447:16)
I tried setting apostrophe-express.bodyParser
to {limit: '50mb', extended: true}
, but that doesn’t seem to work.
Any ideas on how to increase the request size limit?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:20 (3 by maintainers)
Top Results From Across the Web
PayloadTooLargeError: request entity too large - Stack Overflow
So I tried these 3 solutions. 1. app.use(bodyParser.json({limit: '50mb'})); ...
Read more >Error: PayloadTooLargeError: request entity too large in BotKit
Some users have reported they faced issues in botkit. Error: PayloadTooLargeError: request entity too large
Read more >Payloadtoolargeerror request entity too large
apostrophe PayloadTooLargeError : request entity too large when trying to POST to apostrophe-headless API I am using apostrophe-headless, and my payloads are ...
Read more >Extensions and Integrations - ApostropheCMS
Adds REST APIs to ApostropheCMS pieces and pages, powering React/Vue/etc apps with a headless CMS. Repository: apostrophecms/apostrophe-headless; npm ...
Read more >Nestjs 413 Payload Too Large Multipart - ADocLib
Source: stackoverflow.com PayloadTooLargeError: request entity too large using express json react chunk file too large. upload and send file to axios ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This seems to have worked:
better use (you can change the limit of data as you wish - for example 10mb):
app.use(bodyParser.json({limit: ‘10mb’, extended: true})) app.use(bodyParser.urlencoded({limit: ‘10mb’, extended: true}))