Beispiel #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)
Beispiel #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)
Beispiel #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)