From: shan7030 <42472191+shan7030@users.noreply.github.com> Date: Fri, 25 Dec 2020 15:57:14 +0000 (+0530) Subject: Add curio docs in Supported async environments (#1437) X-Git-Tag: 0.17.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4165e9e091f7ca622a996ce531a2e8638e941a0;p=thirdparty%2Fhttpx.git Add curio docs in Supported async environments (#1437) Fixes: #1418 --- diff --git a/docs/async.md b/docs/async.md index 3238097a..69a1fb41 100644 --- a/docs/async.md +++ b/docs/async.md @@ -156,6 +156,27 @@ trio.run(main) !!! important The `trio` package must be installed to use the Trio backend. + +### [Curio](https://github.com/dabeaz/curio) + +Curio is a [coroutine-based library](https://curio.readthedocs.io/en/latest/tutorial.html) +for concurrent Python systems programming. + +```python +import httpx +import curio + +async def main(): + async with httpx.AsyncClient() as client: + response = await client.get('https://www.example.com/') + print(response) + +curio.run(main) +``` + +!!! important + The `curio` package must be installed to use the Curio backend. + ## Calling into Python Web Apps Just as `httpx.Client` allows you to call directly into WSGI web applications,