Skip to content

HTTPCoreXYZ

Test Suite Package version

[!IMPORTANT]
We started this fork because there was no activity on HTTPX, a very popular Python HTTP library.

A few weeks later, Pydantic started their own fork called HTTPX2. We decided to embrace this and support HTTPX2. We're upstreaming our fixes to HTTPX2 and in our opinion it should be the "blessed" fork. Pydantic can make this more successful than we ever can.

See also https://tildeweb.nl/~michiel/httpx2.html

Thanks for all your support!

Sander & Michiel

The HTTP Core XYZ 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 XYZ 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:

$ pip install httpcorexyz

For HTTP/1.1 and HTTP/2 support, install with:

$ pip install httpcorexyz[http2]

For SOCKS proxy support, install with:

$ pip install httpcorexyz[socks]

Example

Let's check we're able to send HTTP requests:

import httpcorexyz

response = httpcorexyz.request("GET", "https://www.example.com/")

print(response)
# <Response [200]>
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'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>\n\n<meta charset="utf-8"/>\n ...'

Ready to get going?

Head over to the quickstart documentation.