python-httpcore
Port variant py310
Summary Minimal low-level HTTP client (3.10)
Package version 0.18.0
Homepage https://www.encode.io/httpcore/
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v11
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 10 SEP 2023, 14:51:03 UTC
Port created 17 JUL 2023, 23:40:12 UTC
Subpackage Descriptions
single # HTTP Core [Test Suite] [Package version] > *Do one thing, and do it well.* The HTTP Core package provides a minimal low-level HTTP client, which does one thing only. Sending HTTP requests. It does not provide any high level model abstractions over the API, does not handle redirects, multipart uploads, building authentication headers, transparent HTTP caching, URL parsing, session cookie handling, content or charset decoding, handling JSON, environment based configuration defaults, or any of that Jazz. Some things HTTP Core does do: * Sending HTTP requests. * Thread-safe / task-safe connection pooling. * HTTP(S) proxy & SOCKS proxy support. * Supports HTTP/1.1 and HTTP/2. * Provides both sync and async interfaces. * Async backend support for `asyncio` and `trio`. ## Requirements Python 3.8+ ## Installation For HTTP/1.1 only support, install with: ```shell $ pip install httpcore ``` For HTTP/1.1 and HTTP/2 support, install with: ```shell $ pip install httpcore[http2] ``` For SOCKS proxy support, install with: ```shell $ pip install httpcore[socks] ``` # Sending requests Send an HTTP request: ```python import httpcore response = httpcore.request("GET", "https://www.example.com/") print(response) # print(response.status) # 200 print(response.headers) # [(b'Accept-Ranges', b'bytes'), (b'Age', b'557328'), (b'Cache-Control', b'max-age=604800'), ...] print(response.content) # b'\n\n\nExample Domain\n\n\n ...' ``` The top-level `httpcore.request()` function is provided for convenience. In practice whenever you're working with `httpcore` you'll want to use the connection pooling functionality that it provides. ```python import httpcore http = httpcore.ConnectionPool() response = http.request("GET", "https://www.example.com/") ``` Once you're ready to get going, [head over to the documentation]. ## Motivation You *probably* don't want to be using HTTP Core directly. It might make sense if you're writing something like a proxy service in Python, and you just want something at the lowest possible level, but more typically you'll want to use a higher level client library, such as `httpx`. The motivation for `httpcore` is: * To provide a reusable low-level client library, that other packages can then build on top of. * To provide a *really clear interface split* between the networking code and client logic, so that each is easier to understand and reason about in isolation.
Configuration Switches (platform-specific settings discarded)
PY310 ON Build using Python 3.10 PY311 OFF Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py310
autoselect-python:single:standard
Build and Runtime python310:single:standard
Runtime (only) python-anyio:single:py310
python-certifi:single:py310
python-h11:single:py310
python-sniffio:single:py310
Download groups
main mirror://PYPIWHL/ac/97/724afbb7925339f6214bf1fdb5714d1a462690466832bf8fb3fd497649f1
Distribution File Information
adc5398ee0a476567bf87467063ee63584a8bce86078bf748e48754f60202ced 76029 httpcore-0.18.0-py3-none-any.whl
Ports that require python-httpcore:py310
No other ports depend on this one.