File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ set with `headers=`.
4444If credentials for the hostname are found, the request is sent with HTTP Basic
4545Auth.
4646
47+ Requests will search for the netrc file at `~/.netrc `, `~/_netrc `, or at the path
48+ specified by the `NETRC ` environment variable. `~ ` denotes the user's home
49+ directory, which is `$HOME ` on Unix based systems and `%USERPROFILE% ` on Windows.
50+
51+ Usage of netrc file can be disabled by setting `trust_env ` to `False ` in the
52+ Requests session::
53+
54+ >>> s = requests.Session()
55+ >>> s.trust_env = False
56+ >>> s.get('https://httpbin.org/basic-auth/user/pass')
4757
4858Digest Authentication
4959---------------------
Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ Note: Custom headers are given less precedence than more specific sources of inf
222222 are specified in ``.netrc ``, which in turn will be overridden by the ``auth= ``
223223 parameter. Requests will search for the netrc file at `~/.netrc `, `~/_netrc `,
224224 or at the path specified by the `NETRC ` environment variable.
225+ Check details in :ref: `netrc authentication <authentication >`.
225226* Authorization headers will be removed if you get redirected off-host.
226227* Proxy-Authorization headers will be overridden by proxy credentials provided in the URL.
227228* Content-Length headers will be overridden when we can determine the length of the content.
You can’t perform that action at this time.
0 commit comments