Skip to content
Myr

Add netrc file search information to authentication documentation (#6876)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Piotr Szlazak · committed by GitHub · parent 5b4b64c · Browse files · 2 files+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−0 removed

  • other:+11 added−0 removed

2 files+11 added−0 removed

modified:docs/user/authentication.rst+10 added
42 unmodified lines
4344If credentials for the hostname are found, the request is sent with HTTP Basic45Auth.4647Requests will search for the netrc file at `~/.netrc`, `~/_netrc`, or at the path48specified by the `NETRC` environment variable. `~` denotes the user's home49directory, which is `$HOME` on Unix based systems and `%USERPROFILE%` on Windows.5051Usage of netrc file can be disabled by setting `trust_env` to `False` in the52Requests session::5354 >>> s = requests.Session()55 >>> s.trust_env = False56 >>> s.get('https://httpbin.org/basic-auth/user/pass')5758Digest Authentication59---------------------6061Another very popular form of HTTP Authentication is Digest Authentication,
94 unmodified lines
modified:docs/user/quickstart.rst+1 added
220 unmodified lines
221* Authorization headers set with `headers=` will be overridden if credentials222 are specified in ``.netrc``, which in turn will be overridden by the ``auth=``223 parameter. Requests will search for the netrc file at `~/.netrc`, `~/_netrc`,224 or at the path specified by the `NETRC` environment variable.225 Check details in :ref:`netrc authentication <authentication>`.226* Authorization headers will be removed if you get redirected off-host.227* Proxy-Authorization headers will be overridden by proxy credentials provided in the URL.228* Content-Length headers will be overridden when we can determine the length of the content.229
342 unmodified lines