def getAccessToken(self,oauth_token,oauth_token_secret,oauth_verifier):
token = oauth.Token(oauth_token,oauth_token_secret)
token.set_verifier(oauth_verifier)
client = oauth.Client(self.consumer, token)
resp, content = client.request(Splitwise.ACCESS_TOKEN_URL, "POST")
if Splitwise.isDebug():
print(resp, content)
#Check if the response is correct
if resp['status'] != '200':
raise Exception("Invalid response %s. Please check your consumer key and secret." % resp['status'])
access_token = dict(parse_qsl(content.decode("utf-8")))
return access_token
评论列表
文章目录