HTTP_Response() does not handle chunked transfer encoding


Sites like ThingSpeak and SmartEnergyGroups use chunked transfer encoding instead of specifying the content length header. Since the current code does not understand this, the response has extra lines before and after the actual content.

I fixed this by searching for the Content-Length header in the response and if it is not there adjusting the ResponseBodyLength and ResponseBody to remove the encoding information and leave the actual content.

Doing this uncovered the bug in the header checking because Content-Length is longer than some other headers.

I have a fix for this issue.


Garrcomm wrote Jun 21, 2014 at 4:17 PM

Hi Frogmore,

I kept the classes as lightweight as possible. Encoding isn't included for this reason. Although chunked transfer encoding isn't too complex, I would add it as a seperate library.
You already have a fix for it, maybe you would like to share that somewhere? :)