HTTP getreply() never returns

Marko.Cain.23 at gmail.com Marko.Cain.23 at gmail.com
Thu Apr 19 21:00:26 CEST 2007


Hi,

I have the following code which send/receive HTTP request/response:

   # where sampleUrl is '127.0.0.1' and
   # url is 'www.cnn.com'

   h = httplib.HTTP(self.sampleUrl, 8080)
        h.putrequest('GET', '/sample?url=' + self.url)
        h.endheaders()

        errcode, errmsg, headers = h.getreply()

But it never returns from h.getreply().

I am using python 2.3.4. Can you please tell me what am I missing?
I am sure the url is correctly. I try putting this 'http://
127.0.0.1:8080/sample?url=www.cnn.com' and it works.

Thank you for any help.




More information about the Python-list mailing list