Skip to content
Myr

Update README

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 5f8000f · Browse files · 1 file+13 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−6 removed

  • other:+13 added−6 removed

1 file+13 added−6 removed

modified:README.md+13 added-6 removed
75 unmodified lines
76---7778## API Reference7980#### `Client([ssl], [timeout], [pool_limits], [max_redirects])`80#### Client8182*An HTTP client, with connection pooling, redirects, cookie persistence, etc.*8384```python85>>> client = Client()86>>> response = await client.get('https://example.org')87```8889* `def __init__([ssl], [timeout], [pool_limits], [max_redirects])`90* `async def .request(method, url, [content], [headers], [stream], [allow_redirects], [ssl], [timeout])`91* `async def .get(url, [headers], [stream], [allow_redirects], [ssl], [timeout])`92* `async def .options(url, [headers], [stream], [allow_redirects], [ssl], [timeout])`93* `async def .head(url, [headers], [stream], [allow_redirects], [ssl], [timeout])`
8 unmodified lines
102### Models103104*Data-structures for HTTP primitives...*105105#### `Response(...)`106#### Response107108*An HTTP response.*109110* `def __init__(...)`111* `.status_code` - **int**112* `.reason_phrase` - **str**113* `.protocol` - `"HTTP/2"` or `"HTTP/1.1"`114* `.url` - **URL**
12 unmodified lines
127* `async def .raw()` - **bytes iterator**128* `async def .close()` - **None**129* `async def .next()` - **Response**130129#### `Request(method, url, content, headers)`131#### Request132133*An HTTP request. Can be constructed explicitly for more control over exactly134what gets sent over the wire.*135
1 unmodified line
137>>> request = Request("GET", "https://example.org", headers={'host': 'example.org'})138>>> response = await client.send(request)139```140141* `def __init__(method, url, content, headers)`142* `.method` - **str** (Uppercased)143* `.url` - **URL**144* `.content` - **byte** or **byte async iterator**145* `.headers` - **Headers**146144#### `URL(url, allow_relative=False)`147#### URL148149*A normalized, IDNA supporting URL.*150151```python
1 unmodified line
153>>> url.host154'example.org'155```156157* `def __init__(url, allow_relative=False)`158* `.scheme` - **str**159* `.authority` - **str**160* `.host` - **str**161* `.port` - **int**
7 unmodified lines
169* `.is_relative_url` - **bool**170* `def .copy_with([scheme], [authority], [path], [query], [fragment])` - **URL**171* `def .resolve_with(url)` - **URL**172169#### `Origin(url)`173#### Origin174175*A normalized, IDNA supporting set of scheme/host/port info.*176177```python178>>> Origin('https://example.org') == Origin('HTTPS://EXAMPLE.ORG:443')179True180```181182* `def __init__(url)`183* `.is_ssl` - **bool**184* `.host` - **str**185* `.port` - **int**186182#### `Headers(headers)`187#### `Headers`188189*A case-insensitive multi-dict.*190191```python
1 unmodified line
193>>> headers['content-type']194'application/json'195```196197* `def __init__(headers)`198199___200201## Alternate backends202
26 unmodified lines