]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Add documentation for requests.Session compatibility (#449) 455/head 459/head
authorJt Miclat <jtmiclat@gmail.com>
Sun, 6 Oct 2019 00:20:18 +0000 (08:20 +0800)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Sun, 6 Oct 2019 00:20:18 +0000 (19:20 -0500)
docs/advanced.md
docs/compatibility.md

index 8a16be649038df83599e6daab8396618e3f223a5..f4a6835b5c213de25cc793ead467bb6198bfc0d7 100644 (file)
@@ -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/')
index d748ddd26d55924da692c8a16c8b82c864a96a41..50a6682cd4790b6945b6e300753f3d52355dbdbd 100644 (file)
@@ -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).