httplib and '100 Continue' after POST

Doug Fort dougfort at downright.com
Sat Dec 30 07:39:47 EST 2000


I believe there is a bug in httplib (I'll send a report to ActiveState,
where I got my distro).

IIS 4 and 5 are subject to send an unsolicited result code of '100 Continue'
with a couple of headers and a blank line before sending '302 Object Moved'.
The 100 response is totally worthless and should be ignored.  Unfortunately,
httplib.HTTPConnection is unwilling to go back and read more headers when it
already has a response object.

I was able to get past this with the following kludge:

                while 1:
                    response = self._client.getresponse()
                    if response.status != 100:
                        break
                    # 2000-12-30 djf -- drop bogus 100 response
                    # by kludging httplib
                    self._client._HTTPConnection__state =
httplib._CS_REQ_SENT
                    self._client._HTTPConnection__response = None

"Doug Fort" <dougfort at downright.com> wrote in message
news:UIi36.7084$Sl.370436 at iad-read.news.verio.net...
> I can't figure out how to persuade httplib to handle a response status of
> '100 Continue'.  Has anyone accomplished this?
>
> --
> Doug Fort
> Senior Meat Manager
> Downright Software
> http://www.dougfort.com/~dougfort
>
>
>





More information about the Python-list mailing list