From 4f853da2ab79d5c16badda490c249557e9c25f6f Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Wed, 24 Mar 2021 17:34:02 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e467b3..930e409 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ from httpx_caching import CachingClient client = AsyncClient() client = CachingClient(client) -async client.get("http://example.com") +await client.get("http://example.com") ``` From 1c9870e82416689c85ce2b904bebe1e7d6d99288 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Wed, 24 Mar 2021 17:36:11 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 930e409..62f1c81 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,19 @@ Adapted from Eric Larson's fantastic [CacheControl](https://github.com/ionrock/c **Usage:** ```python +import asyncio + from httpx import AsyncClient from httpx_caching import CachingClient client = AsyncClient() client = CachingClient(client) -await client.get("http://example.com") +async run_example(): + await client.get("http://example.com") + +loop = asyncio.get_event_loop() +loop.run_until_complete(run_example()) ```