diff --git a/README.md b/README.md index cf6b9b3a..27fd542e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,18 @@ Let's get started... '\n\n\nExample Domain...' ``` +Or, using the async API... + +_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._ + +```python +>>> import httpx +>>> async with httpx.AsyncClient() as client: +>>> r = await client.get('https://www.example.org/') +>>> r + +``` + ## Features HTTPX builds on the well-established usability of `requests`, and gives you: diff --git a/docs/index.md b/docs/index.md index e3d6e2a5..476f62af 100644 --- a/docs/index.md +++ b/docs/index.md @@ -51,6 +51,18 @@ Let's get started... '\n\n\nExample Domain...' ``` +Or, using the async API... + +_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._ + +```python +>>> import httpx +>>> async with httpx.AsyncClient() as client: +>>> r = await client.get('https://www.example.org/') +>>> r + +``` + ## Features HTTPX is a high performance asynchronous HTTP client, that builds on the