New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PayloadTooLargeError: request entity too large when trying to POST to apostrophe-headless API #1291
Comments
This seems to have worked:
|
Interesting. Most of the time JSON encoding is used with apostrophe-headless, and we did bump up the limit for JSON to 16MB recently in the latest npm version of apostrophe. Glad you were able to find the correct configuration for your needs. |
better use (you can change the limit of data as you wish - for example 10mb): app.use(bodyParser.json({limit: '10mb', extended: true})) |
i tried change limit on node_module body-parser from 100kb to 10000kb and it works |
if your data type object or object list, why you dont format your data as JSON. when you get data |
You can avoid parse payload, in case you don't need it (file transfering for example), using param parseReqBody: false |
@pepo205 |
Yeah, I don't think Setting the limit on body-parser is the way to go. |
This was the answer I was looking for! Thanks. I had a base64 encoded json string and couldn't change the limit in any other way |
@marjan-georgiev thanks a lot. I used app.use(bodyParser.urlencoded({limit: '50mb', extended: true })); |
Better use you can specify the limit of your file size as it shown in given line app.use(bodyParser.json({limit: '10mb', extended: true})) You can also change the default setting in node-modules body-parser then in the lib folder, there are JSON and text file. Then change limit here. Actually, this condition pass if you don't pass the limit parameter in the given line |
workng for me thanks |
Worked for me.. Thanks |
But what are the default limits? |
Thank you for the solution works for me! If it still not working check the location where you set it. For me it works after I set it to one of the first "app.use" elements. |
it still not working for me |
This work for me
if you using Nginx on your server you should config Nginx too
|
Thanks man. It worked for me |
Hi folks, since @marjan-georgiev gave the right answer for Apostrophe long ago (see above), I am locking this thread. For general questions about the body-parser module unrelated to apostrophe please see the body-parser module documentation which does cover all this. |
I 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:
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?
The text was updated successfully, but these errors were encountered: