Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions liclient/oauth2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,11 @@ def from_consumer_and_token(cls, consumer, token=None,
'oauth_nonce': cls.make_nonce(),
'oauth_version': cls.version,
}


defaults.update(parameters)
parameters = defaults

if token:
parameters['oauth_token'] = token.key
if token.verifier:
Expand Down Expand Up @@ -587,6 +588,7 @@ def request(self, uri, method="GET", body=None, headers=None,
redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None):
DEFAULT_CONTENT_TYPE = 'application/x-www-form-urlencoded'


if not isinstance(headers, dict):
headers = {}

Expand All @@ -595,7 +597,9 @@ def request(self, uri, method="GET", body=None, headers=None,
if body and method == "POST" and not is_multipart:
parameters = dict(parse_qsl(body))
else:
parameters = None
parameters = {}

parameters['oauth_callback'] = "http://localhost:8080/haha"

req = Request.from_consumer_and_token(self.consumer, token=self.token,
http_method=method, http_url=uri, parameters=parameters)
Expand Down Expand Up @@ -699,4 +703,4 @@ def signing_base(self, request, consumer, token):

def sign(self, request, consumer, token):
key, raw = self.signing_base(request, consumer, token)
return raw
return raw