Skip to content
Myr

Add an async example to intro snippets (#750)

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

authored by Florimond Manca · committed by Tom Christie · parent 780d184 · Browse files · 2 files+24 added−0 removed
This commit

State

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

Diff stats

2 files+24 added−0 removed

  • other:+24 added−0 removed

2 files+24 added−0 removed

modified:docs/index.md+12 added
modified:README.md+12 added
37 unmodified lines
38>>> r.text39'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'40```4142Or, using the async API...4344_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._4546```python47>>> import httpx48>>> async with httpx.AsyncClient() as client:49>>> r = await client.get('https://www.example.org/')50>>> r51<Response [200 OK]>52```5354## Features5556HTTPX builds on the well-established usability of `requests`, and gives you:57
71 unmodified lines