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=`.
44
44
If credentials for the hostname are found, the request is sent with HTTP Basic
45
45
Auth.
46
46
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')
47
57
48
58
Digest Authentication
49
59
---------------------
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
222
222
are specified in ``.netrc ``, which in turn will be overridden by the ``auth= ``
223
223
parameter. Requests will search for the netrc file at `~/.netrc `, `~/_netrc `,
224
224
or at the path specified by the `NETRC ` environment variable.
225
+ Check details in :ref: `netrc authentication <authentication >`.
225
226
* Authorization headers will be removed if you get redirected off-host.
226
227
* Proxy-Authorization headers will be overridden by proxy credentials provided in the URL.
227
228
* 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