Skip to main content

re-quest

Native Python HTTP client with browser-shaped TLS and HTTP/2 transport profiles

Python License Transport Status

re-quest gives Python a request-style API with direct control over TLS and HTTP/2 transport behavior.


Overview

re-quest is a native Python HTTP client designed for transport-aware applications.

Unlike typical Python HTTP clients, re-quest does not rely on the standard ssl request path for its native transport. It constructs ClientHello messages, negotiates TLS, and emits HTTP/2 frames through its own transport implementation.

It keeps the high-level API familiar while exposing browser-shaped transport profiles for TLS, ALPN, HTTP/2 settings, ordered headers, and coherent request metadata.


Highlights

  • Request-style synchronous API
  • Session support
  • Cookies and redirects
  • Ordered browser-style headers
  • Native TLS 1.3 path
  • Native TLS 1.2 fallback path
  • Native HTTP/2 request framing
  • HTTP/1.1 fallback
  • Browser profile registry
  • Fingerprint observation helpers

Installation

python3 -m pip install .

Runtime dependencies:

cryptography>=42
hpack>=4
Brotli>=1
zstandard>=0.23

Quick Start

from re_quest import Session

with Session(profile="chrome") as session:
    response = session.get("https://example.com/")
    print(response.status_code)
    print(response.text[:200])

Session Usage

from re_quest import Session

with Session(profile="android148", timeout=20) as session:
    r1 = session.get("https://example.com/")
    r2 = session.get("https://example.com/next")

    print(r1.status_code)
    print(r2.status_code)

Custom Headers

from re_quest import Session

with Session(profile="chrome") as session:
    response = session.get(
        "https://example.com/",
        headers={
            "X-Demo": "1",
        },
    )

    print(response.status_code)

JSON and Form Requests

from re_quest import Session

with Session(profile="chrome") as session:
    json_response = session.post(
        "https://example.com/api",
        json={"hello": "world"},
    )

    form_response = session.post(
        "https://example.com/form",
        data={"username": "alice"},
    )

Fingerprint Probe

from re_quest import Session

with Session(profile="android148") as session:
    response = session.get("https://tls.peet.ws/api/all")
    data = response.json()

    print(data.get("http_version"))
    print(data.get("tls", {}).get("ja3"))
    print(data.get("http2", {}).get("akamai_fingerprint"))

CLI

List available profiles:

re-quest profiles

Send a request:

re-quest request https://example.com/ --profile chrome

Collect a fingerprint observation:

re-quest fingerprint --profile android148 --out artifacts/fingerprints

Summarize observations:

re-quest report artifacts/fingerprints/*.json

Built-in Profiles

from re_quest import list_profiles

print(list_profiles())

Common aliases:

Alias Description
chrome Default Chromium desktop profile
chrome_windows Chromium desktop profile
android148 Android Chrome 148-style profile
firefox Firefox-style header profile
safari Safari-style header profile
ios iOS Safari-style header profile
edge Edge-style header profile

Some profiles include native Chromium-shaped transport settings. Other profiles currently provide coherent headers while sharing the default native transport shape.


Limitations

  • HTTP/3/QUIC is not implemented.
  • JavaScript and browser runtime APIs are out of scope.
  • Browser profiles require ongoing validation as real browsers change.
  • Some non-Chromium profiles are currently header-level profiles.

Development

Install development dependencies:

python3 -m pip install '.[dev]'

Run tests:

python3 -m pytest

Lightweight syntax/import check:

python3 -m compileall -q re_quest tests examples

License

MIT. See LICENSE.

Metadata

Release files for re-quest 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for re-quest 0.4.1
File Size Uploaded Provenance Actions
re_quest-0.4.1.tar.gz 36.4 kB Without provenance Details for re_quest-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for re-quest 0.4.1
File Interpreter ABI Platform Actions
re_quest-0.4.1-py3-none-any.whl Python 3 none any Details for re_quest-0.4.1-py3-none-any.whl

Total release size: 80.9 kB

Release files / re_quest-0.4.1.tar.gz

Download URL re_quest-0.4.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0f2614262b2ca8936f6e2f89dc60fac38a0fd9c369a6caa17c6f60f6913547cb
BLAKE2b-256 checksum
How to use checksums
104c7872ee707ce713e54ce6bc915395de613d3e70e9269a778f0d83bf2ef8c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / re_quest-0.4.1-py3-none-any.whl

Download URL re_quest-0.4.1-py3-none-any.whl
Size 44.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28714a9d75800a3dcce2ab29a7ff20f47a6a32a731918bd0becadb8c7a0bda0c
BLAKE2b-256 checksum
How to use checksums
f8fce68982f3fcd76bdaf9a11d304cc4f9cab1d4a22fbdff80a88eb5f9f66f00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for re-quest 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page