Hello,
I have a webserver which handles some GET and POST action. With the POST action, if I have a small content length I receive the packets, but when the content length gets bigger, I receive a null body.
I there a limit to the max content length I can receive? Is there a way to increase it?
Thank you,
Mattia
Http post max size
-
- Posts: 35
- Joined: Thu Aug 30, 2018 8:16 am
Re: Http post max size
Hello,
I'm adding some more information to better understand the problem: I use a structure like this:
I see that the netbuf receive only the first 457 bytes, but not all the packet as I would like (around 7000 bytes). If I call more times
I see that I receive what I'm missing, but I don't like such a clumsy way to solve the received data problem...
Do you have any idea?
I'm adding some more information to better understand the problem: I use a structure like this:
Code: Select all
err = netconn_recv(conn, &inbuf);
if (err == ERR_OK) {
// get the request and terminate the string
netbuf_data(inbuf, (void**)&buf, &buflen);
buf[buflen] = '\0';
// get the request body and the first line
char* body = strstr(buf, "\r\n\r\n");
char *request_line = strtok(buf, "\n");
if (request_line) {
....
}
Code: Select all
err = netconn_recv(conn, &inbuf);
Do you have any idea?
Re: Http post max size
This is familiar! I have this exact problem.
I currently see if my length is between 400 and 600, and if I am after more data, I call netconn_recv() again.
Whilst I have used this successfully on large (1MB+) WAV files, I too feel that this is clumsy and there must be a better way.
That being said, I have not had a chance to properly look into it. I would be very interested in any info that people might have..
Cheers,
Sam
I currently see if my length is between 400 and 600, and if I am after more data, I call netconn_recv() again.
Whilst I have used this successfully on large (1MB+) WAV files, I too feel that this is clumsy and there must be a better way.
That being said, I have not had a chance to properly look into it. I would be very interested in any info that people might have..
Cheers,
Sam
Re: Http post max size
Okay, spurred on by this post I have migrated my application webserver over to using the official HTTPD web server component.
It seems to be much more responsive than my previous implementation of netconn/lwip.
https://docs.espressif.com/projects/esp ... erver.html
The library is nice and easy to use, it only took me a few hours to get it all up and running.
It seems to be much more responsive than my previous implementation of netconn/lwip.
https://docs.espressif.com/projects/esp ... erver.html
The library is nice and easy to use, it only took me a few hours to get it all up and running.
Who is online
Users browsing this forum: msfujino and 140 guests