Skip to content
Myr

Use relative links for interlinking markdown files in docs (#1390)

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

authored by Tom Christie · committed by GitHub · parent 16f41a2 · Browse files · 4 files+11 added−11 removed
This commit

State

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

Diff stats

4 files+11 added−11 removed

  • other:+11 added−11 removed

4 files+11 added−11 removed

modified:docs/advanced.md+7 added-7 removed
10 unmodified lines
11 If you do anything more than experimentation, one-off scripts, or prototypes, then you should use a `Client` instance.1213#### More efficient usage of network resources1415When you make requests using the top-level API as documented in the [Quickstart](/quickstart) guide, HTTPX has to establish a new connection _for every single request_ (connections are not reused). As the number of requests to a host increases, this quickly becomes inefficient.15When you make requests using the top-level API as documented in the [Quickstart](quickstart.md) guide, HTTPX has to establish a new connection _for every single request_ (connections are not reused). As the number of requests to a host increases, this quickly becomes inefficient.1617On the other hand, a `Client` instance uses [HTTP connection pooling](https://en.wikipedia.org/wiki/HTTP_persistent_connection). This means that when you make several requests to the same host, the `Client` will reuse the underlying TCP connection, instead of recreating one for every single request.1819This can bring **significant performance improvements** compared to using the top-level API, including:
8 unmodified lines
2829- Cookie persistance across requests.30- Applying configuration across all outgoing requests.31- Sending requests through HTTP proxies.32- Using [HTTP/2](/http2).32- Using [HTTP/2](http2.md).3334The other sections on this page go into further detail about what you can do with a `Client` instance.3536### Usage
26 unmodified lines
63>>> r64<Response [200 OK]>65```6667These methods accept the same arguments as `httpx.get()`, `httpx.post()`, etc. This means that all features documented in the [Quickstart](/quickstart) guide are also available at the client level.67These methods accept the same arguments as `httpx.get()`, `httpx.post()`, etc. This means that all features documented in the [Quickstart](quickstart.md) guide are also available at the client level.6869For example, to send a request with custom headers:7071```pycon
70 unmodified lines
142>>> r.request.url143URL('http://httpbin.org/headers')144```145146For a list of all available client parameters, see the [`Client`](/api/#client) API reference.146For a list of all available client parameters, see the [`Client`](api.md#client) API reference.147148## Calling into Python Web Apps149150You can configure an `httpx` client to call directly into a Python web application using the WSGI protocol.
38 unmodified lines
189```190191## Request instances192193For maximum control on what gets sent over the wire, HTTPX supports building explicit [`Request`](/api#request) instances:193For maximum control on what gets sent over the wire, HTTPX supports building explicit [`Request`](api.md#request) instances:194195```python196request = httpx.Request("GET", "https://example.com")197```
338 unmodified lines
536#### Environment variables537538HTTP proxying can also be configured through environment variables, although with less fine-grained control.539540See documentation on [`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`](/environment_variables/#http_proxy-https_proxy-all_proxy) for more information.540See documentation on [`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`](environment_variables.md#http_proxy-https_proxy-all_proxy) for more information.541542### Proxy mechanisms543544!!! note
129 unmodified lines
674```675676## Multipart file encoding677678As mentioned in the [quickstart](/quickstart#sending-multipart-file-uploads)678As mentioned in the [quickstart](quickstart.md#sending-multipart-file-uploads)679multipart file encoding is available by passing a dictionary with the680name of the payloads as keys and either tuple of elements or a file-like object or a string as values.681682```pycon
377 unmodified lines
modified:docs/compatibility.md+2 added-2 removed
modified:docs/environment_variables.md+1 added-1 removed
139 unmodified lines
140141* [cURL](https://github.com/curl/curl/blob/master/docs/MANUAL.md#environment-variables)142* [requests](https://github.com/psf/requests/blob/master/docs/user/advanced.rst#proxies)143144For more information on using proxies in HTTPX, see [HTTP Proxying](/advanced/#http-proxying).144For more information on using proxies in HTTPX, see [HTTP Proxying](advanced.md#http-proxying).145146### `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY`147148Valid values: A URL to a proxy
31 unmodified lines
modified:docs/third-party-packages.md+1 added-1 removed