📜  带有登录名的 python 请求 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:16.356000             🧑  作者: Mango

代码示例1
>>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"type":"User"...'
>>> r.json()
{'private_gists': 419, 'total_private_repos': 77, ...}