-
Notifications
You must be signed in to change notification settings - Fork 13.3k
http.POST() limit of payload size? #1872
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
Comments
Bump! I'm seeing this same issue ... when my payload crossed the 3k mark I'm now getting a http.POST() return of -3 ... HTTPC_ERROR_SEND_PAYLOAD_FAILED ... but can't find any info on why this is, and what exactly failed? Is there a buffer that needs to be adjusted, or? |
I think payload size > one packet size --> err. |
Ok ... this is what I wondered. I actually created a workaround that I'm using successfully, just in case anyone else requires a similar fix. To do it I had to use WifiClient:
I have a little more response checking and other stuff ... but you get the idea. Using this I am now sending pretty big payloads, and it seems to work fine. The 1000 bytes was just an arbitrary guess ... if I have time I might try to adjust this to fine tune the operation. Obviously there are limitations in this approach as I can't do SSL easily (or can I?) ... but maybe something like this ought to be rolled into the handling of the payload on the call to http.POST in the HTTPClient? |
@Humancell use WiFiClientSecure.h for ssl. Chunk can be large to 1460. |
Thanks! Nice bonus! I'll make my changes. :-) |
I just ran into this issue as well. I believe the limit is just under 2000 Bytes. I hope there is a work around or solution for this. I'd rather use HTTPClient. |
Is there a work around for this issue? I need to send 8000bytes on POST> |
@TheAustrian @Humancell is this issue still valid with latest git? |
I am trying to upload a csv file with size of around 200 kB and using the method |
For me, I broke up the post into multiple posts.
…On Mon, Jan 29, 2018 at 6:54 AM, Mustafa Can Yücel ***@***.*** > wrote:
I am trying to upload a csv file with size of around 200 kB and using the
method int HTTPClient::sendRequest(const char * type, Stream * stream,
size_t size) and get the error HTTPC_ERROR_SEND_PAYLOAD_FAILED. Smaller
size files work perfectly so I am assuming there is an unwritten file size
limit or kind of a bug. This is mentioned in few stackoverflow questions as
well but they have no answer (here
<https://stackoverflow.com/questions/41388417/send-payload-error-in-http-post-arduino-esp8266>
.
Any new information, suggestions, progress, workaround?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1872 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbYZfq_JO_OP1ezEystbN2ttXG2DpOgyks5tPc2ngaJpZM4IBZhy>
.
--
Machine Utilization Tracker
www.mutcloud.com
602.524.0192
|
I see an issue when receiving rss feeds from a news portal over http GET (get string to be clear) One RSS page with kind of high priority news gets transmitted normally and the esp can send it to a lcd display. But whenever I try to get the "normal" news feeds, the esp just doesn't do anything at all. The normal rss feed has 14527 Characters, the high priority one has 2676 Characters... I've gone with the high priority one for now and I can see why nearly 15k characters is a bit overkill for this little thing, but still it's an issue.... |
@espmut How did you manage to divide the file? I used another approach that reads the file into a WiFiClient using MTU_Size chunks but it floods everywhere with stack errors :( |
I could reproduce the error.
2MB data are working flawlessly with all debug options activated (they slow down processing a lot). Full sketch:
The
|
@TheAustrian @mcanyucel @espmut can you unbreak-to-one-piece your POST and try this pull-request #4265 ? @Silberlachs the fix is about outgoing data (not incoming data). If it still does not work for you, then please open a new issue with a minimal sketch to highlight the bug. It will be a lot easier for us to reproduce then fix. |
Why people use HTTPclient, when they can use normal HTTP request under ESP8266Wifi.h library? |
@martinius96 Are you referring the |
@mcanyucel Yes WIficlient. What is difference between wificlient and HTTPclient (BasicHttpClient.ino file)? It do the same thing.. |
In a manner of speaking. As far as I have seen |
@martinius96 @TheAustrian @mcanyucel @espmut the fix is now in master. Can you test it ? |
@d-a-v Thank you very much for your extremely quick response. I am a little bit overwhelmed with some other stuff nowadays but hopefully I will be able to test it within a few days or maybe early next week. |
@mcanyucel @TheAustrian @Humancell could you please confirm the fix? I think this is the only pending for release 2.4.1. |
@devyte I really wish to try but we have deployed all our MCU boards to field. I have ordered several ESP8266s but it will take some time for them to arrive. If I can find a spare around I will try it. |
I'm sorry that I somehow missed your request, and the Github notice back in February! It was funny, but I ran into this issue again last night, with the payload being too large, and found this thread to check back on the status. I did update to v2.4.2 ... and this does fix the issue that I was seeing! I'm now POSTing bigger payloads just fine! One other issue that I did see, is that I has to add a line to set:
Before reading the response stream. Without this, my code that was running just fine before, (v2.3.0) now seemed to have a default timeout of 4000ms! It would just hang. I added the line above, and now it's fine. |
I seem to be suffering a similar problem, however in my case I think it might be related to free heap and fragmentation but have not been able to find any workarounds. So in the code I have arrays with a bunch of data which im trying to send to a backend. Due to the fact that the arrays are of considerable size, im splitting up posts to aprox less then 2kB (It should not be necessary but im running out of heap). I do this by calling this function several times, the code surrounding it retries several times in case of error:
Sorry for the long post, most of it is debug output... Next is the output:
As you can see from the output, the exact same size of data succeeds only on the second try and eventually aborts due to lack of minimum free heap required for the json parser buffer. Anyone has this problem? Is this a bug in HTTPClient? Am I asking too much for my esp? |
After spending MANY hours trying to upload ESP32-CAM photos, i found out the problem was only with big photos (e.g. bigger than VGA) and big files (txt) in general, so i finally found the problem was with the POST body in general..
|
@ligantx Hey i am trying to send base64 image in POST request 2 I tryed simmilar approach like you: I divide my string by 10 parts with code like this
And finished with output like this(i made base64 chunks short on purpose) : |
Hi!
I'm trying to send data as an HTTPClient to a server with http.POST() and it works great but the payload gets cut off around the 3000 character mark. Does this have something to do with "application/x-www-form-urlencoded"? It shouldn't, iirc, cause POST shouldn't have a size limit?
I just wanted to know if there is a limit on payload size so I can rule out some other issue with my server. The String I'm sending gets put out normally in the serial monitor, so that shouldn't be the problem.
Thanks!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: