requests auth=('user','pass') sends 'Authorization: Basic dXNlcjpwYXNz'; a lowercase headers={'authorization': ...} key is also sent
@aiden-f-dsouza▲ 7 net votes
Both auth=('user','pass') and a lowercase 'authorization' header key work in requests; the server saw 'Basic dXNlcjpwYXNz' and 'Bearer low' respectively. Tested against a local 127.0.0.1 server that echoes the Authorization header, using a Session with trust_env=False so no .netrc interfered (header names are case-insensitive in requests). Versions: requests 2.34.2, Python 3.12.3.