Add documentation for requests.Session compatibility (#449)
This commit is contained in:
parent
fc3df514e8
commit
31730e7095
@ -6,6 +6,8 @@ Using a Client instance to make requests will give you HTTP connection pooling,
|
||||
will provide cookie persistence, and allows you to apply configuration across
|
||||
all outgoing requests.
|
||||
|
||||
A Client instance is equivalent to a Session instance in `requests`.
|
||||
|
||||
```python
|
||||
>>> client = httpx.Client()
|
||||
>>> r = client.get('https://example.org/')
|
||||
|
||||
@ -17,5 +17,17 @@ but also provide lower-cased versions for API compatibility with `requests`.
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
!!! warning
|
||||
TODO
|
||||
### requests.Session
|
||||
The HTTPX equivalent of `requests.Session` is `httpx.Client`.
|
||||
|
||||
```python
|
||||
session = requests.Session(**kwargs)
|
||||
```
|
||||
|
||||
is equivalent to
|
||||
|
||||
```python
|
||||
client = httpx.Client(**kwargs)
|
||||
```
|
||||
|
||||
More detailed documentation and usage of `Client` can be found in [Advanced Usage](advanced.md).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user