Example #1
0
 def _call_api_with_creds(self, credentials, api_name):
     """Get a given url from the webservice with credentials."""
     url = (self.base_url + api_name).encode('utf-8')
     method = "GET"
     logger.debug("getting url: %s, %s", method, url)
     msg = Soup.Message.new(method, url)
     add_oauth_headers(msg.request_headers.append, method, url, credentials)
     d = defer.Deferred()
     self.session.queue_message(msg, self._handler, d)
     return d
Example #2
0
 def _call_api_with_creds(self, credentials, api_name):
     """Get a given url from the webservice with credentials."""
     url = (self.base_url + api_name).encode('utf-8')
     method = "GET"
     logger.debug("getting url: %s, %s", method, url)
     headers = {}
     add_oauth_headers(headers.__setitem__, method, url, credentials)
     d = client.getPage(url, headers=headers)
     d.addCallback(self._handle_response)
     d.addErrback(self._handle_error)
     return d