GET /api/accounts HTTP/1.1 Content-Type: application/json X-Access-Token: username:token
这种 API,Python 要怎么调用啊??POST 登录生成 token 以后要怎么调用啊??? 求告知
闭关修行中......
import requests token = '从你存储的地方取值' headers = { 'Content-Type': 'application/json', 'X-Access-Token': 'username:{0}'.format(token) } r = request.get('/api/accounts', headers=headers) print r.text
把获得的token保存在本地,每次请求的时候带上token就好了
import requests
r = requests.get(url)
import requestsr = requests.get(url, cookies=cookies)
把获得的token保存在本地,每次请求的时候带上token就好了
import requests
r = requests.get(url)
import requests
r = requests.get(url, cookies=cookies)