HttpRequest::getBody() is empty for IE XMLHttpRequest
IE seems to sends XMLHttpRequest as two TCP packets (see https://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post). I could verify this for a simple request with IE11 on a win7 box using wireshark.
However, this seems to confuse Sming, it will report an empty request body. The webserver seems to handle fragmented packets not correctly.
A possible workaround might be to use GET instead of POST.
@tius2000 : I think the issue you are describing will be taken care of in the update @patrickjahns is preparing which adds http_upload functionality.
Great! Thank you for the super-fast feedback @hreintke :-)
@tius2000 try my ported fix by @patrickjahns https://github.com/avr39-ripe/SmingRTOS/commit/5b46bbe335f36098d1d22ee5a7ca8fd83ccd8e2e
@avr39-ripe: Sorry, I'm new to git - how can I apply your fix to my cloned local SmingRTOS files?
https://github.com/avr39-ripe/SmingRTOS/commit/5b46bbe335f36098d1d22ee5a7ca8fd83ccd8e2e.patch
here is patch. download it into SmingRTOS dir, then patch < patch_nam.patch and viola :)
Thank you very much @avr39-ripe! I applied the patch and XMLHttpRequest works with IE now, too :+1:
However, there is a small side effect. The return value of getBody has changed from const char * to String. This means that an additional copy of the data needs to be allocated for parsing the posted data with JsonBuffer::parseObject(). While this no problem for my application, it might be inefficient for larger strings.