Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

got POST working FINALLY

  • Loading branch information...
commit e176e50105c6353ee854239f99736bbcdcb36eb0 1 parent bd8f83c
@brosner brosner authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 contacts_import/oauth_consumer.py
View
10 contacts_import/oauth_consumer.py
@@ -73,7 +73,7 @@ def fetch_unauthorized_token(self):
callback_url = reverse("oauth_callback", kwargs={"service": self.service})
request = oauth.Request.from_consumer_and_token(self.consumer,
http_url = self.request_token_url,
- #http_method = "POST",
+ http_method = "POST",
parameters = {
"oauth_callback": "%s%s" % (base_url, callback_url),
}
@@ -141,9 +141,11 @@ def _oauth_request(self, url, token, http_method="GET", params=None):
def _oauth_response(self, request):
# @@@ not sure if this will work everywhere. need to explore more.
http = httplib2.Http()
- if request.http_method == "POST":
- ret = http.request(request.http_url, "POST",
- data = request.to_postdata(),
+ headers = {}
+ headers.update(request.to_header())
+ if request.method == "POST":
+ ret = http.request(request.url, "POST",
+ headers = headers,
)
else:
ret = http.request(request.to_url(), "GET")
Please sign in to comment.
Something went wrong with that request. Please try again.