Skip to content
Myr

Add netrc environment variable into the documentation (#1675)

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

* Adding netrc environment variable documentation * Update docs/environment_variables.md Co-authored-by: Tom Christie <tom@tomchristie.com> * Modifications about netrcfile environment variable * Change uppercase "A" in netrcfile env variable into lowercase * Added some words and a dot before "my_netrc" in the console example * changed a typo "rather that" into "rather than" in advanced.md * changed netrc environment variable in example part * modified title for netrc environment variable part in doc * Deleted the dot in title of netrc environment variable

authored by Mei · committed by GitHub · parent 3231211 · Browse files · 2 files+14 added−1 removed
This commit

State

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

Trailers

  • Co-authored-by: Tom Christie <tom@tomchristie.com>

Diff stats

2 files+14 added−1 removed

  • other:+14 added−1 removed

2 files+14 added−1 removed

modified:docs/advanced.md+1 added-1 removed
368 unmodified lines
369370...371```372373When using `Client` instances, `trust_env` should be set on the client itself, rather that on the request methods:373When using `Client` instances, `trust_env` should be set on the client itself, rather than on the request methods:374375```python376client = httpx.Client(trust_env=False)377```
807 unmodified lines
modified:docs/environment_variables.md+13 added
130 unmodified lines
131```console132SSL_CERT_DIR=/path/to/ca-certs/ python -c "import httpx; httpx.get('https://example.com')"133```134135## `NETRC`136137Valid values: a filename138139If this environment variable is set but auth parameter is not defined, HTTPX will add auth information stored in the .netrc file into the request's header. If you do not provide NETRC environment either, HTTPX will use default files. (~/.netrc, ~/_netrc)140141Example:142143```console144NETRC=/path/to/netrcfile/.my_netrc python -c "import httpx; httpx.get('https://example.com')"145```146147## Proxies148149The environment variables documented below are used as a convention by various HTTP tooling, including:150
35 unmodified lines
186# These requests will be sent directly, bypassing the proxy187python -c "import httpx; httpx.get('http://127.0.0.1:5000/my-api')"188python -c "import httpx; httpx.get('https://www.python-httpx.org')"189```190