Need help with httplib

Jeremy Hylton jeremy at alum.mit.edu
Sun Aug 18 12:52:49 EDT 2002


"Carl Waldbieser" <waldbie at attglobal.net> wrote in message news:<4CF79.8724$H67.47845 at tor-nn1.netcom.ca>...
> I am trying to create a simple web server that forwards GET, HEAD, and POST
> requests to a different server and then sends the response back to the
> original client.  I am using the BaseHTTPServer and httplib modules to try
> and do this.  I almost have it working correctly except for a problem with
> the POST.  The request data is successfully POSTed, but when the (real) web
> server responds to my redirecting web server, it sends back a status of 100,
> Continue.
> 
> I am no HTTP expert, but I tried digging through some RFCs to try and figure
> this one out.  As far as I can tell, the web server is not suposed to send
> this status back unless I sent an "Expect" request header of "100-continue",
> which the client does not send.

I haven't checked the RFC, but I don't believe the Expect header has
anything to do with 100-continue.  There is nothing unusual about a
server sending a 100 continue response for a POST.

You haven't mentioned which version of Python you're using, but it
probably doesn't matter.  I think all released versions of Python have
an httplib that does not handle 100 continue responses.  The code has
been fixed and will be available as soon as 2.2.2 and 2.3 are
released.  Until then, you may want to grab the latest source from CVS
and see if that helps.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Lib/httplib.py

Jeremy



More information about the Python-list mailing list