HTTP chunk Transfer-Encoding

Francis Meyvis francis.meyvis at sonycom.com
Thu Feb 28 10:09:12 EST 2002


Found myself the answer in Zope & RFC 2616

in do_GET(self) when sending the headers add

SimpleHTTPRequestHandler.send_header(self, "Transfer-Endcoding", "chunked")

when sending the data (imagine it is in variable d)

self.wfile.write("%x\r\n%s\r\n" % (len(d), d))
self.wfile.write("0\r\n\r\n" )

---
Kind regards, best wishes,
francis meyvis
Thomas Weholt <thomas at gatsoft.no> wrote in message
news:Byqf8.135$5vh.170870272 at news.telia.no...
> Medusa has some code for that. I'm looking into implementing that myself
but
> don't have the time right now. Please post any code or findings you can
> share.
>
> Best regards,
> Thomas Weholt
>
>
> "Francis Meyvis" <francis.meyvis at sonycom.com> wrote in message
> news:4Wpf8.13$zd.865 at nreader2.kpnqwest.net...
> > Hoi,
> >
> > Is there some python source that sends chunked packets (RFC 2616) in
> > the SimpleHTTPServer or BaseHTTPServer?
> > Or do you know where to find snippet of code that can split up
> > file to send them in chunk format?
> >
> > Thx
> >
> > --
> > ---
> > Kind regards, best wishes,
> > francis meyvis
> >
> >
>
>





More information about the Python-list mailing list