From 1fa262628fdbdb6a5dfa904e8a1350761211f894 Mon Sep 17 00:00:00 2001 From: Mike Helmick Date: Sat, 28 Mar 2015 07:51:29 -0400 Subject: [PATCH] Optional parameter --- twython/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/twython/api.py b/twython/api.py index f324565..902dbe0 100644 --- a/twython/api.py +++ b/twython/api.py @@ -385,7 +385,7 @@ class Twython(EndpointsMixin, object): return authorized_tokens # pragma: no cover - def obtain_request_tokens(self, oauth_callback, x_auth_access_type='read'): + def obtain_request_tokens(self, oauth_callback, x_auth_access_type=''): """Allows a Consumer application to obtain an OAuth Request Token to request user authorization. @@ -404,9 +404,11 @@ class Twython(EndpointsMixin, object): """ data = { 'oauth_callback': oauth_callback, - 'x_auth_access_type': x_auth_access_type, } + if x_auth_access_type: + data['x_auth_access_type'] = x_auth_access_type + response = self.client.post(self.request_token_url, data=data) request_tokens = dict(parse_qsl(response.content.decode('utf-8')))