-
Notifications
You must be signed in to change notification settings - Fork 702
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
Not able to set limit in body parser #176
Comments
I have the same problem and I'm trying to add:
then get error: bodyParser.raw is not a function. My problem still not be fixed yet. I use AFNetworking to upload a picture which no more than 1mb.
|
Hi @UditKaul, I cannot reproduce your issue, and there is almost no information to go on in your report. Can you please provide all the following?
@Thanatos-L your issue sounds different from the one above, in particular, your |
@dougwilson thank you for your concern,but i found a solution to my problem just by doing the following. app.use(bodyParser({limit: '50mb'})); |
Hi @UditKaul, oh, wow, I'm really sorry, but I actually copy-and-pasted your code incorrectly myself when I tried to test! So the reason why app.use(bodyParser());
app.use(bodyParser({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb'})); does not work is because you are using it over and over. I was assuming that you were simply showing three different ways, not that you actually had all three of those in your code. You see, you are actually defining the same body parsing multiple times for no reason, and since Now in your new example, the first |
I am trying to increase the limit of request entity allowed in body-parser. I tried this but was no good.
app.use(bodyParser());
app.use(bodyParser({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb'}));
The error message says "Error: request entity too large" and the status code is 413.
The text was updated successfully, but these errors were encountered: