HTTP 1.1 client in Python.
Doug Fort
dougfort at downright.com
Tue May 29 15:56:08 EDT 2001
Syver Enstad wrote:
> I have some trouble making the HTTPConnection class in httplib (that says
> it supports 1.1) to handle 100 continue messages from the http server. I
> had to resort to a truly ghastly hack to get the content from the server,
> because 100 code is just a message that tells the client it can now send
> the message body. The HTTPConnection doesn't seem to understand this, or
> maybe I use it wrongly. If there were anybody on this list that knew how
> to make a HTTP 1.1 client with Python some pointers would be much
> appreciated.
>
> Syver Enstad
>
>
>
Here's how I did it.
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
I submitted this as bug #227361 on SourceForge.
--
Doug Fort <dougfort at downright.com>
Senior Meat Manager
Downright Software LLC
http://www.downright.com
______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
With Seven Servers In California And Texas - The Worlds Uncensored News Source
More information about the Python-list
mailing list