{ "info": { "author": "Tom Christie", "author_email": "tom@tomchristie.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Internet :: WWW/HTTP" ], "description": "# HTTPCore\n\n\n \"Build\n\n\n \"Coverage\"\n\n\n \"Package\n\n\n## Feature support\n\n* `HTTP/2` and `HTTP/1.1` support.\n* `async`/`await` support for non-blocking HTTP requests.\n* Strict timeouts everywhere by default.\n* Fully type annotated.\n* 100% test coverage.\n\nPlus all the standard features of requests...\n\n* International Domains and URLs\n* Keep-Alive & Connection Pooling\n* Sessions with Cookie Persistence\n* Browser-style SSL Verification\n* Basic/Digest Authentication *TODO - We have Basic, but not Digest yet.*\n* Elegant Key/Value Cookies\n* Automatic Decompression\n* Automatic Content Decoding\n* Unicode Response Bodies\n* Multipart File Uploads *TODO - Request content currently supports URL encoded data, JSON, bytes, or async byte iterators.*\n* HTTP(S) Proxy Support *TODO*\n* Connection Timeouts\n* Streaming Downloads\n* .netrc Support *TODO*\n* Chunked Requests\n\n## Usage\n\nMaking a request:\n\n```python\n>>> import httpcore\n>>> client = httpcore.Client()\n>>> response = client.get('https://example.com')\n>>> response.status_code\n\n>>> response.protocol\n'HTTP/2'\n>>> response.text\n'\\n\\n\\nExample Domain\\n...'\n```\n\nAlternatively, async requests:\n\n**Note**: Use `ipython` to try this from the console, since it supports `await`.\n\n```python\n>>> import httpcore\n>>> client = httpcore.AsyncClient()\n>>> response = await client.get('https://example.com')\n>>> response.status_code\n\n>>> response.protocol\n'HTTP/2'\n>>> response.text\n'\\n\\n\\nExample Domain\\n...'\n```\n\n---\n\n## Dependencies\n\n* `h2` - HTTP/2 support.\n* `h11` - HTTP/1.1 support.\n* `certifi` - SSL certificates.\n* `chardet` - Fallback auto-detection for response encoding.\n* `idna` - Internationalized domain name support.\n* `rfc3986` - URL parsing & normalization.\n* `brotlipy` - Decoding for \"brotli\" compressed responses. *(Optional)*\n\nA huge amount of credit is due to `requests` for the API layout that\nmuch of this work follows, as well as to `urllib3` for plenty of design\ninspiration around the lower level networking details.\n\n---\n\n## API Reference\n\n### `Client`\n\n*An HTTP client, with connection pooling, redirects, cookie persistence, etc.*\n\n```python\n>>> client = Client()\n>>> response = client.get('https://example.org')\n```\n\n* `def __init__([auth], [cookies], [verify], [cert], [timeout], [pool_limits], [max_redirects], [dispatch])`\n* `def .request(method, url, [data], [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .get(url, [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .options(url, [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .head(url, [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .post(url, [data], [json], [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .put(url, [data], [json], [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .patch(url, [data], [json], [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .delete(url, [data], [json], [params], [headers], [cookies], [auth], [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .prepare_request(request)`\n* `def .send(request, [stream], [allow_redirects], [verify], [cert], [timeout])`\n* `def .close()`\n\n### `Response`\n\n*An HTTP response.*\n\n* `def __init__(...)`\n* `.status_code` - **int** *(Typically a `StatusCode` IntEnum.)*\n* `.reason_phrase` - **str**\n* `.protocol` - `\"HTTP/2\"` or `\"HTTP/1.1\"`\n* `.url` - **URL**\n* `.headers` - **Headers**\n* `.content` - **bytes**\n* `.text` - **str**\n* `.encoding` - **str**\n* `.is_redirect` - **bool**\n* `.request` - **Request**\n* `.cookies` - **Cookies**\n* `.history` - **List[Response]**\n* `def .raise_for_status()` - **None**\n* `def .json()` - **Any**\n* `def .read()` - **bytes**\n* `def .stream()` - **bytes iterator**\n* `def .raw()` - **bytes iterator**\n* `def .close()` - **None**\n* `def .next()` - **Response**\n\n### `Request`\n\n*An HTTP request. Can be constructed explicitly for more control over exactly\nwhat gets sent over the wire.*\n\n```python\n>>> request = Request(\"GET\", \"https://example.org\", headers={'host': 'example.org'})\n>>> response = client.send(request)\n```\n\n* `def __init__(method, url, [params], [data], [json], [headers], [cookies])`\n* `.method` - **str**\n* `.url` - **URL**\n* `.content` - **byte** or **byte async iterator**\n* `.headers` - **Headers**\n* `.cookies` - **Cookies**\n\n### `URL`\n\n*A normalized, IDNA supporting URL.*\n\n```python\n>>> url = URL(\"https://example.org/\")\n>>> url.host\n'example.org'\n```\n\n* `def __init__(url, allow_relative=False, params=None)`\n* `.scheme` - **str**\n* `.authority` - **str**\n* `.host` - **str**\n* `.port` - **int**\n* `.path` - **str**\n* `.query` - **str**\n* `.full_path` - **str**\n* `.fragment` - **str**\n* `.is_ssl` - **bool**\n* `.origin` - **Origin**\n* `.is_absolute_url` - **bool**\n* `.is_relative_url` - **bool**\n* `def .copy_with([scheme], [authority], [path], [query], [fragment])` - **URL**\n* `def .resolve_with(url)` - **URL**\n\n### `Origin`\n\n*A normalized, IDNA supporting set of scheme/host/port info.*\n\n```python\n>>> Origin('https://example.org') == Origin('HTTPS://EXAMPLE.ORG:443')\nTrue\n```\n\n* `def __init__(url)`\n* `.is_ssl` - **bool**\n* `.host` - **str**\n* `.port` - **int**\n\n### `Headers`\n\n*A case-insensitive multi-dict.*\n\n```python\n>>> headers = Headers({'Content-Type': 'application/json'})\n>>> headers['content-type']\n'application/json'\n```\n\n* `def __init__(self, headers)`\n\n### `Cookies`\n\n*A dict-like cookie store.*\n\n```python\n>>> cookies = Cookies()\n>>> cookies.set(\"name\", \"value\", domain=\"example.org\")\n```\n\n* `def __init__(cookies: [dict, Cookies, CookieJar])`\n* `.jar` - **CookieJar**\n* `def extract_cookies(response)`\n* `def set_cookie_header(request)`\n* `def set(name, value, [domain], [path])`\n* `def get(name, [domain], [path])`\n* `def delete(name, [domain], [path])`\n* `def clear([domain], [path])`\n* *Standard mutable mapping interface*\n\n___\n\n## Alternate backends\n\n### `AsyncClient`\n\nAn asyncio client.\n\n### `TrioClient`\n\n*TODO*\n\n---\n\n## The Stack\n\nThere are two main layers in the stack. The client handles redirection,\ncookie persistence (TODO), and authentication (TODO). The dispatcher\nhandles sending the actual request and getting the response.\n\n* `Client` - Redirect, authentication, cookies etc.\n* `ConnectionPool(Dispatcher)` - Connection pooling & keep alive.\n * `HTTPConnection` - A single connection.\n * `HTTP11Connection` - A single HTTP/1.1 connection.\n * `HTTP2Connection` - A single HTTP/2 connection, with multiple streams.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/encode/encode", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "encode", "package_url": "https://pypi.org/project/encode/", "platform": "", "project_url": "https://pypi.org/project/encode/", "project_urls": { "Homepage": "https://github.com/encode/encode" }, "release_url": "https://pypi.org/project/encode/0.0.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "...", "version": "0.0.0" }, "last_serial": 5312472, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "35e61d335e6aeb55fcdbd22dc33d2e59", "sha256": "bb79966ae0274363551cd6454537cddb13ad6347190d662e8cda2860b12b4f5f" }, "downloads": -1, "filename": "encode-0.0.0.tar.gz", "has_sig": false, "md5_digest": "35e61d335e6aeb55fcdbd22dc33d2e59", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 27069, "upload_time": "2019-05-24T12:00:50", "url": "https://files.pythonhosted.org/packages/b3/96/c3433d817f31e1bd93f4b07bc970b95e7e9e12ac3a6e15d03c98efc26324/encode-0.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35e61d335e6aeb55fcdbd22dc33d2e59", "sha256": "bb79966ae0274363551cd6454537cddb13ad6347190d662e8cda2860b12b4f5f" }, "downloads": -1, "filename": "encode-0.0.0.tar.gz", "has_sig": false, "md5_digest": "35e61d335e6aeb55fcdbd22dc33d2e59", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 27069, "upload_time": "2019-05-24T12:00:50", "url": "https://files.pythonhosted.org/packages/b3/96/c3433d817f31e1bd93f4b07bc970b95e7e9e12ac3a6e15d03c98efc26324/encode-0.0.0.tar.gz" } ] }