http的auth,requests的auth参数
python3的requests库的auth参数
代码如:
import requests
uname = 'abca'
upsd = '******
headers = {'content-type': 'application/json'}
url = 'http://111.111.111.111:15672/api//api/queues'
rsp = requests.get(url, headers=headers, auth=(uname, upsd))
aaa = res.json()
其中的auth可以直接拼接在url里
curl里对应的是-u参数
curl -i -u user01:testmima http://localhost:15672/api/vhosts