From: Tom Christie Date: Wed, 1 May 2019 14:39:53 +0000 (+0100) Subject: Update README X-Git-Tag: 0.3.0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=891548ea7ea52d41f5a2dcace05c46ca366825af;p=thirdparty%2Fhttpx.git Update README --- 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**