GET /api/accounts HTTP/1.1
Content-Type: application/json
X-Access-Token: username:token
这种 API,Python 要怎么调用啊??
POST 登录生成 token 以后要怎么调用啊??? 求告知
PHPzhong2017-04-17 17:52:10
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