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
Provenance
- Commit
2de053e- Tree
3646cfe- Author
Tom Christie <tom@tomchristie.com>- Committer
Tom Christie <tom@tomchristie.com>- Parent
5f8000f
1 file changed+13 added−6 removed
modified:README.md+13 added-6 removed
75 unmodified lines76 ---77 78 ## API Reference79 80-#### `Client([ssl], [timeout], [pool_limits], [max_redirects])`80+#### Client81 82 *An HTTP client, with connection pooling, redirects, cookie persistence, etc.*83 84 ```python85 >>> client = Client()86 >>> response = await client.get('https://example.org')87 ```88 89+* `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 lines102 ### Models103 104 *Data-structures for HTTP primitives...*105 105-#### `Response(...)`106+#### Response107 108 *An HTTP response.*109 110+* `def __init__(...)`111 * `.status_code` - **int**112 * `.reason_phrase` - **str**113 * `.protocol` - `"HTTP/2"` or `"HTTP/1.1"`114 * `.url` - **URL**12 unmodified lines127 * `async def .raw()` - **bytes iterator**128 * `async def .close()` - **None**129 * `async def .next()` - **Response**130 129-#### `Request(method, url, content, headers)`131+#### Request132 133 *An HTTP request. Can be constructed explicitly for more control over exactly134 what gets sent over the wire.*135 1 unmodified line137 >>> request = Request("GET", "https://example.org", headers={'host': 'example.org'})138 >>> response = await client.send(request)139 ```140 141+* `def __init__(method, url, content, headers)`142 * `.method` - **str** (Uppercased)143 * `.url` - **URL**144 * `.content` - **byte** or **byte async iterator**145 * `.headers` - **Headers**146 144-#### `URL(url, allow_relative=False)`147+#### URL148 149 *A normalized, IDNA supporting URL.*150 151 ```python1 unmodified line153 >>> url.host154 'example.org'155 ```156 157+* `def __init__(url, allow_relative=False)`158 * `.scheme` - **str**159 * `.authority` - **str**160 * `.host` - **str**161 * `.port` - **int**7 unmodified lines169 * `.is_relative_url` - **bool**170 * `def .copy_with([scheme], [authority], [path], [query], [fragment])` - **URL**171 * `def .resolve_with(url)` - **URL**172 169-#### `Origin(url)`173+#### Origin174 175 *A normalized, IDNA supporting set of scheme/host/port info.*176 177 ```python178 >>> Origin('https://example.org') == Origin('HTTPS://EXAMPLE.ORG:443')179 True180 ```181 182+* `def __init__(url)`183 * `.is_ssl` - **bool**184 * `.host` - **str**185 * `.port` - **int**186 182-#### `Headers(headers)`187+#### `Headers`188 189 *A case-insensitive multi-dict.*190 191 ```python1 unmodified line193 >>> headers['content-type']194 'application/json'195 ```196 197+* `def __init__(headers)`198+199 ___200 201 ## Alternate backends202 26 unmodified lines