Writing byte stream as jpeg format to disk

Robert Kern robert.kern at gmail.com
Thu Aug 26 17:34:34 EDT 2010


On 8/26/10 4:25 PM, Navkirat Singh wrote:

> @Robert - Thanks a lot for your time :-) , I did know that the body starts after
> the occurrence two CRLF sequences, but I was following RFC2616 as a guide, which
> specifically mentions:
>
> "The presence of a message-body in a request is signaled by the inclusion of a
>
> Content-Length or Transfer- Encoding header field in the
>
> request’s message-headers"
>
> Which has not been done by the author of the library, hence I said what I did.
> Or I have misunderstood the RFC

It certainly looks like the data has a Content-length header:

b': image/jpeg\r\nAccept: text/*\r\nReferer: 
http://127.0.0.1:8001/\r\nAccept-Language: en-us\r\nAccept-Encoding: gzip, 
deflate\r\nContent-Length: 91783\r\n
...

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list