Update README.md

This commit is contained in:
Tom Christie 2019-04-08 10:13:48 +01:00 committed by GitHub
parent 01a3c09064
commit 337eb70eb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,8 @@ The intent is that this library could be the low-level implementation, that `req
## Usage
Making a request:
```python
import httpcore
@ -34,21 +36,21 @@ assert response.status_code == 200
assert response.body == b'Hello, world'
```
Top-level API...
Top-level API:
```python
http = httpcore.ConnectionPool([ssl], [timeout], [limits])
response = await http.request(method, url, [headers], [body], [stream])
```
ConnectionPool as a context-manager...
ConnectionPool as a context-manager:
```python
async with httpcore.ConnectionPool([ssl], [timeout], [limits]) as http:
response = await http.request(method, url, [headers], [body], [stream])
```
Streaming...
Streaming responses:
```python
http = httpcore.ConnectionPool()