Skip to main content

httpp

License: MIT CMake 3.21+ C++17 Python 3.8+

A lightweight HTTP client + server library for C++ and Python. pip install httpp and you get: a Python package, a CLI, a compiled C++ library with headers and a CMake config — no system dependencies at all (no apt/choco/brew, nothing outside what pip already gives you).

Why

  • Client and server in one library — most lightweight HTTP libraries only do one side.
  • Zero system dependencies — every third-party piece is vendored and built from source.
  • One pip install, three ways in — Python API, a CLI, and a real C++ library (headers + find_package(httpp)) all come from the same wheel.
  • A migration path for existing libcurl code — httpp/curl_compat.h gives you curl_easy_* so you can often switch with just a header swap.

Install

pip install httpp

Quick start

Python

from httpp import Client, Server, DownloadFile, CurlRequest

# client
res = Client.fetch("http://example.com/")
print(res.status, res.body)

# server — like `python -m http.server`, but embeddable in your own app
srv = Server()
srv.serve_directory("/", "./public")
srv.listen("0.0.0.0", 8000)

# download a file, with a tqdm-like progress bar
DownloadFile("http://example.com/big.zip").output("big.zip").run()

# a small curl-flavored request builder
res = CurlRequest("http://example.com/api").method("POST").data("a=1").run()

CLI

httpp server .                              # serve the current directory
httpp download http://example.com/          # print body to stdout
httpp download http://example.com/f.zip -o f.zip   # save to a file, with a progress bar
httpp curl -X POST -H "X-Token: abc" -d "a=1" http://example.com/api
httpp install --user                        # put headers/lib/cmake config on your system

C++

#include <httpp.h>

auto res = httpp::client::fetch("http://example.com/");

httpp::server srv;
srv.get("/hello", [](const httpp::request&, httpp::response& res) {
    res.status = 200;
    res.body = "world";
});
srv.listen("0.0.0.0", 8000);

httpp::download_file("http://example.com/f.zip").output("f.zip").run();

auto res2 = httpp::curl::request("http://example.com/api")
                .method("POST")
                .header("X-Token", "abc")
                .data("a=1")
                .run();

Migrating from libcurl

#include <httpp/curl_compat.h>   /* was: #include <curl/curl.h> */

CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &out);
CURLcode rc = curl_easy_perform(curl);
curl_easy_cleanup(curl);

Covers the common curl_easy_* subset (URL, method, headers, POST data, write callback, timeout, follow-redirect, response code) — not a full libcurl replacement. See the comment at the top of curl_compat.h for the exact list.

Using it from CMake, from a plain pip install

No system-wide install needed — point CMake at the package Python already installed:

execute_process(
    COMMAND python3 -c "import httpp; print(httpp.get_cmake_dir())"
    OUTPUT_VARIABLE httpp_DIR
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_package(httpp CONFIG REQUIRED)
target_link_libraries(app PRIVATE httpp::httpp_core)

Or, after httpp install [--user], plain find_package(httpp) works with no Python involved at all — see tests/cmake/consumer_project for a full working example.

Build from source

git clone --recurse-submodules https://github.com/MohammadRaziei/httpp.git
cd httpp
pip install -r requirements-dev.txt
cmake -B build -DHTTPP_BUILD_TESTS=ON -DHTTPP_BUILD_PYTHON=ON
cmake --build build -j4
ctest --test-dir build --output-on-failure   # C++, Python, and CMake-integration tests

Status

  • httpp::client — GET requests; .fetch(url) parses a full URL in one call
  • httpp::server — route handlers, static directory serving
  • httpp::curl — a small curl-flavored fluent request builder (method/headers/data)
  • httpp::download_file — fluent download builder with a terminal progress bar (sync .run() and async .run_async())
  • httpp::progress — bar (tqdm-like) and range (trange-like)
  • httpp/curl_compat.h — a curl_easy_* C API subset for migrating existing libcurl code, built directly on httpp::curl::request
  • CLI — server, download, curl, install/uninstall
  • Python bindings for Client, Server, DownloadFile, CurlRequest
  • HTTPS
  • Route handlers from Python (directory serving works today; custom routes are C++-only for now)

License

MIT

Metadata

Release files for httpp 0.4.0

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

Source distribution (sdist)

Source distribution for httpp 0.4.0
File Size Uploaded Provenance
httpp-0.4.0.tar.gz 233.8 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for httpp 0.4.0
File
httpp-0.4.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
httpp-0.4.0-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details
httpp-0.4.0-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details
httpp-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
httpp-0.4.0-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.4.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
httpp-0.4.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
httpp-0.4.0-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
httpp-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
httpp-0.4.0-cp311-cp311-macosx_10_13_universal2.whl CPython 3.11 CPython 3.11 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.4.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
httpp-0.4.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
httpp-0.4.0-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details
httpp-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
httpp-0.4.0-cp310-cp310-macosx_10_13_universal2.whl CPython 3.10 CPython 3.10 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.4.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
httpp-0.4.0-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
httpp-0.4.0-cp39-cp39-musllinux_1_2_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.2+ x86-64 Details
httpp-0.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
httpp-0.4.0-cp39-cp39-macosx_10_13_universal2.whl CPython 3.9 CPython 3.9 macOS 10.13+ universal2 (ARM64, x86-64) Details

Total release size: 18.7 MB

Release files / httpp-0.4.0.tar.gz

Download URL httpp-0.4.0.tar.gz
Size 233.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e6f594ac1c84d23e7649447d2a0330a332d502d01edc54450953d4a125a60270
BLAKE2b-256 checksum
How to use checksums
1544d74b939e90535bd119a4442f8dff6191eba83a2910ee809eb588b9891b57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp312-cp312-win_amd64.whl

Download URL httpp-0.4.0-cp312-cp312-win_amd64.whl
Size 688.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
97b84124cde27b5fc5111e5112ed51e4a4cfb00950dad57b491a64d8efe5bc95
BLAKE2b-256 checksum
How to use checksums
057a1c23d6ca2e0f3e91d89ff886645536924856914f53b791e630299f161de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp312-cp312-win32.whl

Download URL httpp-0.4.0-cp312-cp312-win32.whl
Size 611.7 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
f2336544ebe0e632261b9cd37ba9b1e941675f7b0688df31b53e788718876560
BLAKE2b-256 checksum
How to use checksums
9199edab0ff37034d173987afe19ca58ddaf1733b5f409fefce08ad7ac0d96f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL httpp-0.4.0-cp312-cp312-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7acccb1fbaa15cc8ae35276bb9fc04ee9068bd9d48fed528bd5602bce1b3ac6a
BLAKE2b-256 checksum
How to use checksums
39a66a3bf7a5d583a0f499f0d87b40b525bcfe2fce87a207d279b1ff93e0b967
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 598.8 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
40bf12ce63cc7f516c89a841c06d52a7f599635de9fb8638f80374420ba3cd2a
BLAKE2b-256 checksum
How to use checksums
9e9b8f3ab2ed1467234877a8bd31eb65030196a5f833797ddf45a3ebe5fd6ea5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp312-cp312-macosx_10_13_universal2.whl

Download URL httpp-0.4.0-cp312-cp312-macosx_10_13_universal2.whl
Size 1.1 MB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
1d7a74d7a1775499a94d02317de0a07a1691c5d98773e7342a8935a104d1b3ff
BLAKE2b-256 checksum
How to use checksums
c89c0ef294ef450b72aecc00c548ce544b32c6254950b728bbf7c9310922ba4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp311-cp311-win_amd64.whl

Download URL httpp-0.4.0-cp311-cp311-win_amd64.whl
Size 688.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
fe8489ed7ca19fd69bf7e7e95639ed2a81764a4aa04bb91826ebdf0ef46578f2
BLAKE2b-256 checksum
How to use checksums
099e60914438346f165261cf4afe485313dd6f9cdb4ed07f9ef4b5854d4d4901
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp311-cp311-win32.whl

Download URL httpp-0.4.0-cp311-cp311-win32.whl
Size 611.2 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
a94660d04fbeccd8f6d7e080cd67416aeeee5744253addc7b1fc9b2d49cbfe04
BLAKE2b-256 checksum
How to use checksums
98377726701942ca27c4339949edbd63d83cb75fb5354860bb009b678ddfdb4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL httpp-0.4.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
6e1710b2a6edd5c2e7a214aa3f29a620f9cd9e845322b135b504dc814e2891cc
BLAKE2b-256 checksum
How to use checksums
a25a8a8bb8167231e78e8043766e7fb5fa3f9cac6982543a221c94a1d88b73f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 600.8 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7bd3c3a23dbff5468234a18fe5648c06f35d75be358a74dcebd0be37b4206ec2
BLAKE2b-256 checksum
How to use checksums
6fd921f40c24331db51783fa8f240b072d0df3a57b40441819b44a9eeed6ff49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp311-cp311-macosx_10_13_universal2.whl

Download URL httpp-0.4.0-cp311-cp311-macosx_10_13_universal2.whl
Size 1.1 MB
Tags CPython 3.11 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
e59275f4d51eba3be5b37adc00fb71f162c1ccdb1ec66991a1b3c67efe890ec8
BLAKE2b-256 checksum
How to use checksums
666f496e89b564a7a5407603ac5a2b20b53b876d0d9ba259f660282926419667
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp310-cp310-win_amd64.whl

Download URL httpp-0.4.0-cp310-cp310-win_amd64.whl
Size 688.2 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d49fb5a05b0b5d50b0138b3620dc5cbfa392324a0e2296607677f08c7f3e6992
BLAKE2b-256 checksum
How to use checksums
1e7dccba4dbb68681c34c660892fa5006b5c25c8bccad4e6ecb56ac703efa6c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp310-cp310-win32.whl

Download URL httpp-0.4.0-cp310-cp310-win32.whl
Size 611.3 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
f6adcb1e16d1ad4fdea8d9001caa4e0924468f41d99e0387478e81155127d0e1
BLAKE2b-256 checksum
How to use checksums
622649c0d3f9681708b30e955279f989e763c4ffee29ecaddf3bc125cc3598bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL httpp-0.4.0-cp310-cp310-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
77d23d0d73319067c17218cebf76988b4e6efc821f9973159a1917d07be6ca4f
BLAKE2b-256 checksum
How to use checksums
207565e9a27ab6523f1bab08d996ddc921e60ac8529518d84fbae6a72e079fbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 601.1 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a05d397e42153f0842eb1778e4050454e295e7fe16805f7982278a82e5d1f0fa
BLAKE2b-256 checksum
How to use checksums
3b0f77574ba1d5424f1bf07a79e45202a0fec38fe1b2b5b54726f2b5328e5867
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp310-cp310-macosx_10_13_universal2.whl

Download URL httpp-0.4.0-cp310-cp310-macosx_10_13_universal2.whl
Size 1.1 MB
Tags CPython 3.10 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
c75ea815ac66351f0fa543cf7918cf7a1a9b3e2df3f751bca5a92e568dce8ac0
BLAKE2b-256 checksum
How to use checksums
5075f8c022f8cae256eb82e682c814e416435158b9910983e8a6a117a21f444c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp39-cp39-win_amd64.whl

Download URL httpp-0.4.0-cp39-cp39-win_amd64.whl
Size 688.5 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
7b3eb05208a2a1960dff103dd1b0cec4236ab8f3ab6fc580db02c26581cab51b
BLAKE2b-256 checksum
How to use checksums
4b59952d9979484c82e498b5166341048855f16b7e2da61810d112ba39a18e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp39-cp39-win32.whl

Download URL httpp-0.4.0-cp39-cp39-win32.whl
Size 611.7 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
9e20bbc9021c0625d0cd7485fd0abdfdb8e6cd91ee7eb173d7f6ed119904d5ec
BLAKE2b-256 checksum
How to use checksums
db08c5307d8c17b7ce59806c7f32466eb46693bce7c31a88490d403a54d70563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp39-cp39-musllinux_1_2_x86_64.whl

Download URL httpp-0.4.0-cp39-cp39-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
3b39917bd4c79353e39eca9fdd3ff1c0f91d45d27165d4d8556ffbeb1ec46e6f
BLAKE2b-256 checksum
How to use checksums
440d03978e4b26d9b2fd4d7873b137d0b917390e60bab6174c7cf73beb0be167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 602.0 kB
Tags CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
97d63621f45399d78f6d2967ac6f5704bf870df1a5601329899f2731f496057e
BLAKE2b-256 checksum
How to use checksums
a77c077fcabca535dc845596c21980091a780a99399bc5a8172911e25b2555c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / httpp-0.4.0-cp39-cp39-macosx_10_13_universal2.whl

Download URL httpp-0.4.0-cp39-cp39-macosx_10_13_universal2.whl
Size 1.1 MB
Tags CPython 3.9 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
39581094da7dfb5da6b4ad8b515b99a8658c6a82dfd39030498b20f56ed11ece
BLAKE2b-256 checksum
How to use checksums
0d8cc13b2d36ff7c67138d02d5afe2b86d506b4bb40dfda6c33a979bbd5eea29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for httpp 0.4.0

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.

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