From 9e8bc0912152fdaf2736e2666729977c8c55e833 Mon Sep 17 00:00:00 2001 From: Michael Helmick Date: Wed, 21 Mar 2012 11:41:27 -0400 Subject: [PATCH] Fixes #67 Dynamic callback url --- twython/twython.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/twython/twython.py b/twython/twython.py index 80ed8ea..a7ad3be 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -215,10 +215,14 @@ class Twython(object): callback_url = self.callback_url or 'oob' request_args = {} - if OAUTH_LIB_SUPPORTS_CALLBACK: - request_args['callback_url'] = callback_url + request_args['oauth_callback'] = callback_url + method = 'get' - response = self.client.get(self.request_token_url, **request_args) + if not OAUTH_LIB_SUPPORTS_CALLBACK: + method = 'post' + + func = getattr(self.client, method) + response = func(self.request_token_url, data=request_args) if response.status_code != 200: raise TwythonAuthError("Seems something couldn't be verified with your OAuth junk. Error: %s, Message: %s" % (response.status_code, response.content))