Re: ResponseNotReady exception

Discussion in 'Python' started by Chris Rebert, Jan 3, 2009.

  1. Chris Rebert

    Chris Rebert Guest

    On Sat, Jan 3, 2009 at 12:38 PM, asit <> 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
     
    Chris Rebert, Jan 3, 2009
    #1
    1. Advertising

  2. Chris Rebert

    asit Guest

    On Jan 4, 1:59 am, "Chris Rebert" <> wrote:
    > On Sat, Jan 3, 2009 at 12:38 PM, asit <> 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


    Thanx
     
    asit, Jan 3, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gandalf

    httplib ResponseNotReady

    Gandalf, Oct 12, 2004, in forum: Python
    Replies:
    0
    Views:
    1,385
    Gandalf
    Oct 12, 2004
  2. Gandalf

    Re: httplib ResponseNotReady

    Gandalf, Oct 12, 2004, in forum: Python
    Replies:
    0
    Views:
    637
    Gandalf
    Oct 12, 2004
  3. Max
    Replies:
    2
    Views:
    2,268
  4. pedr0

    HTTP ResponseNotReady

    pedr0, Oct 4, 2011, in forum: Python
    Replies:
    4
    Views:
    1,213
    pedr0
    Oct 4, 2011
  5. Manu

    ResponseNotReady in httplib

    Manu, Mar 28, 2012, in forum: Python
    Replies:
    0
    Views:
    386
Loading...

Share This Page