Exemplo n.º 1
0
 def __get(self, path, headers, args=None):
     path = path
     # response = yield treq.get(path, params=args, agent=self.custom_agent, headers=headers)
     response = yield treq.get(path, headers=headers, params=args)
     content = yield treq.content(response)
     logger.debug("getting URL: {path}  headers: {headers}", path=path, agent=self.custom_agent, headers=headers)
     final_response = self.decode_results(content, self.response_headers(response), response.code, response.phrase)
     returnValue(final_response)
Exemplo n.º 2
0
 def __delete(self, path, headers, args={}):
     response = yield treq.delete(path, params=args, agent=self.custom_agent, headers=headers)
     content = yield treq.content(response)
     final_response = self.decode_results(content, self.response_headers(response), response.code, response.phrase)
     returnValue(final_response)
Exemplo n.º 3
0
 def __put(self, path, headers, data):
     response = yield treq.put(path, data=data, agent=self.custom_agent, headers=headers)
     content = yield treq.content(response)
     final_response = self.decode_results(content, self.response_headers(response), response.code, response.phrase)
     returnValue(final_response)