ResponseNotReady exception

Chris Rebert clp at rebertia.com
Sat Jan 3 15:59:37 EST 2009


On Sat, Jan 3, 2009 at 12:38 PM, asit <lipun4u at gmail.com> wrote:
> import httplib
>
> class Server:
>    #server class
>    def __init__(self, host):
>        self.host = host
>    def fetch(self, path):
>        http = httplib.HTTPConnection(self.host)
>        http.putrequest("GET", path)

According to the docs, if you use .putrequest(), you have to also then
call .putheader() [as many times as necessary], .endheaders(), and
.send(), in that order. I'd advise just changing .putrequest() to
.request() instead.

And you should also read the fine docs yourself:
http://docs.python.org/library/httplib.html

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list