代码:
import requests from requests.auth import HTTPBasicAuth def test_auth(): res=requests.get(url="https://httpbin.testing-studio.com/basic-auth/banana/123", auth=HTTPBasicAuth("banana","123")) print(res.json())
执行结果:
2022-09-21 17:29:23
代码:
import requests from requests.auth import HTTPBasicAuth def test_auth(): res=requests.get(url="https://httpbin.testing-studio.com/basic-auth/banana/123", auth=HTTPBasicAuth("banana","123")) print(res.json())
执行结果: