Add an async example to intro snippets (#750)
This commit is contained in:
parent
780d1843ca
commit
7d84408cda
12
README.md
12
README.md
@ -39,6 +39,18 @@ Let's get started...
|
||||
'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
|
||||
```
|
||||
|
||||
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
|
||||
<Response [200 OK]>
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
HTTPX builds on the well-established usability of `requests`, and gives you:
|
||||
|
||||
@ -51,6 +51,18 @@ Let's get started...
|
||||
'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
|
||||
```
|
||||
|
||||
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
|
||||
<Response [200 OK]>
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
HTTPX is a high performance asynchronous HTTP client, that builds on the
|
||||
|
||||
Loading…
Reference in New Issue
Block a user