Python httplib ResponseNotReady

前端 未结 6 707
南笙
南笙 2020-12-04 23:59

I\'m writing a REST client for elgg using python, and even when the request succeeds, I get this in response:

Traceback (most recent call last):
  File \"tes         


        
6条回答
  •  广开言路
    2020-12-05 00:24

    I was running into this same exception today, using this code:

        conn = httplib.HTTPConnection(self._host, self._port)
        conn.putrequest('GET',
            '/retrieve?id={0}'.format(parsed_store_response['id']))
        retr_response = conn.getresponse()
    

    I didn't notice that I was using putrequest rather than request; I was mixing my interfaces. ResponseNotReady is raised because I haven't actually sent the request yet.

提交回复
热议问题