Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to pass 'Authorization' header value in OAuth 2.0 with Google APIs
  2. additional_headers = {
  3.         "Authorization": "OAuth "+GoogleOAuth2Mixin.access_token,
  4.         "Accept-Encoding": None
  5.     }
  6.     h = httputil.HTTPHeaders()
  7.     h.parse_line("Authorization: OAuth "+GoogleOAuth2Mixin.access_token)
  8.     request = httpclient.HTTPRequest(self._USER_INFO_URL+"?access_token="+GoogleOAuth2Mixin.access_token, method="GET", headers=h)
  9.     self.httpclient_instance.fetch(
  10.         request,
  11.         self.async_callback(callback)
  12.     )