Apr-20-2020, 09:11 PM
from requests.auth import HTTPBasicAuth import sys request = requests.get(url,timeout=30, verify = False, auth = HTTPDigestAuth( id, pw )) if response.status_code == 401: response = requests.get(url, auth=HTTPBasicAuth('user', 'pass') if response == 200: ... else: print("still got an error") sys.exit(-1)