From 891548ea7ea52d41f5a2dcace05c46ca366825af Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 1 May 2019 15:39:53 +0100 Subject: [PATCH] Update README --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 649affdb..d55796e7 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,13 @@ Additionally, credit is due to for `urllib3` for plenty of design inspiration. #### `Client([ssl], [timeout], [pool_limits], [max_redirects])` +*An HTTP client, with connection pooling, redirects, cookie persistence, etc.* + +```python +>>> client = Client() +>>> response = await client.get('https://example.org') +``` + * `async def .request(method, url, [content], [headers], [stream], [allow_redirects], [ssl], [timeout])` * `async def .get(url, [headers], [stream], [allow_redirects], [ssl], [timeout])` * `async def .options(url, [headers], [stream], [allow_redirects], [ssl], [timeout])` @@ -93,6 +100,8 @@ Additionally, credit is due to for `urllib3` for plenty of design inspiration. ### Models +*Data-structures for HTTP primitives...* + #### `Response(...)` *An HTTP response.* @@ -123,7 +132,7 @@ Additionally, credit is due to for `urllib3` for plenty of design inspiration. what gets sent over the wire.* ```python ->>> request = Request("GET", "http://example.org", headers={'host': 'example.org'}) +>>> request = Request("GET", "https://example.org", headers={'host': 'example.org'}) >>> response = await client.send(request) ``` @@ -136,6 +145,12 @@ what gets sent over the wire.* *A normalized, IDNA supporting URL.* +```python +>>> url = URL("https://example.org/") +>>> url.host +'example.org' +``` + * `.scheme` - **str** * `.authority` - **str** * `.host` - **str** -- 2.47.3