2012-02-10 2 views
0

예외를 없애려고합니다. (Google Application Engine에서 실행되는) python27 API에서 httplib를 사용할 때 HTTPException ('ApplicationError : 5',) - 자세한 내용은이 게시물 ApplicationError2 and ApplicationError5 when communicating with external api from AppEngine. 아마 httplib2를 사용해 볼 수도 있다고 생각했습니다. 내가 볼 수있는 HTTPLIB에 대한 호출을 만드는 API의 유일한 부분은 다음과 같습니다httplib2의 httplib.HTTPConnection()에 직접 해당하는 것이 있습니까

def _get_conn(self): 
    return httplib.HTTPConnection(str(self.host), str(self.port), timeout=120) 

httplib2에서 httplib.HTTPConnection()에 직접 해당하는이 있습니까? 나는 수색을했지만 아무것도 찾을 수 없습니다.

답변

1

AppEngineHttpConnectionhttp2 source code에있는 것으로 보입니다. 오히려 같은 것을 할 거라고 자신 documentation 같이 AFAIK 그 공식 httplib2의 API의 일부가 아닌 그러나

, :

import httplib2 
h = httplib2.Http() 
resp, content = h.request("http://bitworking.org/") 
assert resp.status == 200 
assert resp['content-type'] == 'text/html' 

당신이 Request library를 사용하여 생각 해 봤나를, 그것은 좋은 많이 받고있다 최근 언론.

관련 문제