Request 身份认证
2020-03-12 本文已影响0人
落地逃
from requests.auth import HTTPBasicAuth
from requests.auth import HTTPDigestAuth
r=requests.get(base_url+'basic_auth/51zxw/8888',auth=HTTPBasicAuth('51zxw','8888'))
print(r.text)
r=requests.get(base_url+'digest_auth/auth/zxw/666',auth=HTTPDigestAuth('zxw','666'))
print(r.text)