import requests as req
url = "https://httpbin.org/basic-auth/123/123"
re = req.get(url, auth=('123','123'))
print(re.text)
import requests as req
url = "https://httpbin.org/basic-auth/123/123"
re = req.get(url)
print(re.text)
import requests as req
url = "https://httpbin.org/basic-auth/123/123"
re = req.get(url)
print(re)
此時的terminal會回傳:<Response [401]>,驗證碼為410,這代表驗證沒有通過。
如果帳號密碼都輸入正確,則會獲得:<Response [200]>