Permalink
Browse files

improve _oauth_response (at least in the LinkedIn case I hope)

  • Loading branch information...
1 parent 57489bd commit f23802c3c7d967c1373c11a34415e89acc7af1a7 @brosner brosner committed Dec 29, 2009
Showing with 6 additions and 5 deletions.
  1. +6 −5 contacts_import/oauth_consumer.py
@@ -139,12 +139,13 @@ def _oauth_request(self, url, token, http_method="GET", params=None):
return request
def _oauth_response(self, request):
+ # @@@ not sure if this will work everywhere. need to explore more.
http = httplib2.Http()
- # @@@ hack for now
- if request.http_method == "POST":
- ret = http.request(request.http_url, "POST", request.to_postdata())
- else:
- ret = http.request(request.to_url(), "GET")
+ headers = {}
+ headers.update(request.to_header())
+ ret = http.request(request.http_url, request.http_method,
+ headers = headers,
+ )
response, content = ret
logger.debug(repr(ret))
return content

0 comments on commit f23802c

Please sign in to comment.