import requests
token = {
"access_token": "q3eFsG5ONt6fvdJsB3AAXL38KBAwrdCJ0",
"api_server": "https:\/\/api07.iq.questrade.com\/",
"expires_in": 1800,
"refresh_token": "Y3p43laee75kfDxzDWrONoNpkhgAFUyb0",
"token_type": "Bearer"
}
uri = "https://api01.iq.questrade.com/v1/markets"
headers = {'Authorization': 'Bearer {}'.format(token.get('access_token'))}
rt = requests.get(uri, headers=headers)
response = rt.json()
我不明白这里发生了什么,因为token
已更新,但我得到<Response [401]>
。我该怎么做才能解决问题?
答案 0 :(得分:0)
你的错误在这里:
"api_server": "https:\/\/api07.iq.questrade.com\/"
你有\/
,你应该使用通常的那个:
"api_server": "https://api07.iq.questrade.com/"