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, Request

# 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 = Request("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::client::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 (with optional headers), response headers (res.header("Content-Type")); .fetch(url) parses a full URL in one call. HTTP and HTTPS (mbedtls-backed).
  • httpp::server — route handlers, static directory serving
  • httpp::client::request — a small curl-flavored fluent request builder (method/headers/data/timeout/redirects), also over HTTPS
  • 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, including response headers (CURLOPT_HEADERFUNCTION) and CURLINFO_CONTENT_TYPE, built directly on httpp::client::request
  • CLI — server, download, curl, install/uninstall, path (httpp --cmake-dir / httpp path --include-dir, etc.)
  • Python bindings for Client, Server, DownloadFile, Request
  • Route handlers from Python (directory serving works today; custom routes are C++-only for now)

License

MIT

Metadata

Release files for httpp 0.5.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.5.0
File Size Uploaded Provenance
httpp-0.5.0.tar.gz 238.8 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for httpp 0.5.0
File
httpp-0.5.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
httpp-0.5.0-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details
httpp-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details
httpp-0.5.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.5.0-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.5.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
httpp-0.5.0-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details
httpp-0.5.0-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
httpp-0.5.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.5.0-cp311-cp311-macosx_10_13_universal2.whl CPython 3.11 CPython 3.11 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.5.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
httpp-0.5.0-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details
httpp-0.5.0-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details
httpp-0.5.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.5.0-cp310-cp310-macosx_10_13_universal2.whl CPython 3.10 CPython 3.10 macOS 10.13+ universal2 (ARM64, x86-64) Details
httpp-0.5.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
httpp-0.5.0-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
httpp-0.5.0-cp39-cp39-musllinux_1_2_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.2+ x86-64 Details
httpp-0.5.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
httpp-0.5.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: 23.6 MB

Release files / httpp-0.5.0.tar.gz

Download URL httpp-0.5.0.tar.gz
Size 238.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6a7d1bb5550d1b17a095168f6715767bba8ddb6c7332d91000a891d5443b7c7e
BLAKE2b-256 checksum
How to use checksums
d64a58df681baff0708d813b25e23fabc40d072edeeefefbff2950b35f1c5762
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.5.0-cp312-cp312-win_amd64.whl

Download URL httpp-0.5.0-cp312-cp312-win_amd64.whl
Size 724.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7fed657e0b1daaa6231e217b7a6d8fc341896165b8b2ff3e8712cadf25accb52
BLAKE2b-256 checksum
How to use checksums
3bb295a862255eed7e114c17611981bb4a080ef7166d016ce2b577d296933877
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.5.0-cp312-cp312-win32.whl

Download URL httpp-0.5.0-cp312-cp312-win32.whl
Size 643.0 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
26fafc6f56b39633c5bbbe298e83d9519646762461e22bc0aae00f52406cf968
BLAKE2b-256 checksum
How to use checksums
612529cf4d713b68bbe03a7b2c34b66468de2a3636b0b7dd72acd2d175ac97f1
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.5.0-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL httpp-0.5.0-cp312-cp312-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
c6b1ac56707223e0ad27dfb4c8a20f49304aeb4aa79d3eaadd03b0d8499b5069
BLAKE2b-256 checksum
How to use checksums
f688bf48fd016457ef13e12a78bddf17d02fcb74975dffd29e36c47ab164d014
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.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 928.5 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
32736c1ef8cdb7f9da4b9e572b4aa08908a8d3bff4b2025e95578f2ba840fe3b
BLAKE2b-256 checksum
How to use checksums
d2bef6937a874864d38ebb0ad1637aaa336020af4795c84bf8559e34626c0751
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.5.0-cp312-cp312-macosx_10_13_universal2.whl

Download URL httpp-0.5.0-cp312-cp312-macosx_10_13_universal2.whl
Size 1.6 MB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
503c17d1cdfbed9ba82366be8c684d2e5ed102b546cf48d41bb5ca10b2825a10
BLAKE2b-256 checksum
How to use checksums
9316c84a103b6d4b34b9a662493f010455534f873e301ebbfaff12224fbdab2d
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.5.0-cp311-cp311-win_amd64.whl

Download URL httpp-0.5.0-cp311-cp311-win_amd64.whl
Size 724.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
81d1af67ae548cc2d098a7ebf97c1dd238f4dd597ce18ef0ff869413b0c346d3
BLAKE2b-256 checksum
How to use checksums
8d310a425de87017b82597d5ab313d82d5cdc7e2a159598146dfcf9bd0fa3ba3
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.5.0-cp311-cp311-win32.whl

Download URL httpp-0.5.0-cp311-cp311-win32.whl
Size 642.4 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
0b1607e73bd7e03812a61ab03fced273025a4279457f578394be27cca5aea514
BLAKE2b-256 checksum
How to use checksums
d9cd072800e82f1f94ed6a8f2506f00fdfde626db91def7e919ee2006aacbee2
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.5.0-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL httpp-0.5.0-cp311-cp311-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
9f05eb4802f52b27507b4dcd1c7fd52daf246ffa861343bd32d3a514870b8eba
BLAKE2b-256 checksum
How to use checksums
560fbf2c6ea942031a48972e3af65be0a0ab248e8e343bca98c5bd67eeeee5e8
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.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 929.4 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0aeff41fbca23d9991f69269e5e33dbcf31ace9434c672e6bd603a36ec9935f3
BLAKE2b-256 checksum
How to use checksums
3f7800f97828949b534bf500f35d8a20a12a1a61d70d3e5aef19eb255c1ff714
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.5.0-cp311-cp311-macosx_10_13_universal2.whl

Download URL httpp-0.5.0-cp311-cp311-macosx_10_13_universal2.whl
Size 1.6 MB
Tags CPython 3.11 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
d1309e57f92f5ee4f309637a2fb0c7458529ea9e1ed05e9f38adc7dd0ede4d52
BLAKE2b-256 checksum
How to use checksums
8fdea81449fbea5896c7d4707d4007e4cc6c77b9e34b98fcda38b955840fb6a4
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.5.0-cp310-cp310-win_amd64.whl

Download URL httpp-0.5.0-cp310-cp310-win_amd64.whl
Size 724.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
34ebfda89025334261cc7f84fdd0654a9da09ec13c9ea66c6a6fc7592b9b88d4
BLAKE2b-256 checksum
How to use checksums
58aa367213fcb568bd618ad91ddf6758bf5107952f5036dd997bf802d4a91796
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.5.0-cp310-cp310-win32.whl

Download URL httpp-0.5.0-cp310-cp310-win32.whl
Size 642.7 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
5951bf80302e2eaf6f28f31333c40edc3dca204d6624c87bfd1b1420954bd726
BLAKE2b-256 checksum
How to use checksums
4fc0e6b54badee84223219969182244ad225cf8628ba853a68874bb2bbc91a56
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.5.0-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL httpp-0.5.0-cp310-cp310-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
00c2474f5c750bed45cb14cef033095d091ff1dc28683d05dbd43b607193eb35
BLAKE2b-256 checksum
How to use checksums
c39dc7f343bdd9bfcd93c4097b02485051f9a0e1a726f8f5f7b2c887af7f4c6c
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.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 929.8 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
570a3ac02375b29f055a04d8a355132f3f7f517090e5c4a6f0e790ac39548992
BLAKE2b-256 checksum
How to use checksums
1e8313e93a177b8fb1f3bf981c563ae54665a421430878bb88691f6622ee7ed3
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.5.0-cp310-cp310-macosx_10_13_universal2.whl

Download URL httpp-0.5.0-cp310-cp310-macosx_10_13_universal2.whl
Size 1.6 MB
Tags CPython 3.10 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
0c5228f46abb9acf2e099ffd3405f3702bf0f4b721968ec4321eafd10a38f947
BLAKE2b-256 checksum
How to use checksums
10f57938faef04c3432cee738e52545bca60575b3b988a1ff6020aaceec68d3a
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.5.0-cp39-cp39-win_amd64.whl

Download URL httpp-0.5.0-cp39-cp39-win_amd64.whl
Size 724.6 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
17b1fad3f5200c7e1b79e86d32d3e959857c148f433f17692be260bab4e527e2
BLAKE2b-256 checksum
How to use checksums
d9d730a0fc10938c8e3a1e248cfae1347b995a096fe016921f88ab3486d3a3dd
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.5.0-cp39-cp39-win32.whl

Download URL httpp-0.5.0-cp39-cp39-win32.whl
Size 643.0 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
a1bd91077450f1ded762d5041df68ec97e79955b967c1532a4d1636d6091fe4f
BLAKE2b-256 checksum
How to use checksums
0bee63d1d0f7f1e71b527a587ca107d13c917610353b7cb47cf300380caa3878
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.5.0-cp39-cp39-musllinux_1_2_x86_64.whl

Download URL httpp-0.5.0-cp39-cp39-musllinux_1_2_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7c67e53e92da575627141782f3fd49bfae2a421ac1621ab2bf4a2770dc5e0a5c
BLAKE2b-256 checksum
How to use checksums
6709242d8a63d86039dcca32bcb0701299ec8eb26fc30d5fb53f4f4565f1720b
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.5.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL httpp-0.5.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 930.1 kB
Tags CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fed3302518737b4a3a1c69466de9da8ba9fdea7e5321a790cd18de5a93dd053a
BLAKE2b-256 checksum
How to use checksums
14c5ff711588c370fd50761b53e8529bc28cfb9806f4aa050d999a6fad5d99fb
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.5.0-cp39-cp39-macosx_10_13_universal2.whl

Download URL httpp-0.5.0-cp39-cp39-macosx_10_13_universal2.whl
Size 1.6 MB
Tags CPython 3.9 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
08680195450eb7eaa7d987bc41419f5081a3236d95a5faf1f571e4c0d47ad5f5
BLAKE2b-256 checksum
How to use checksums
43bc9242a94656e25bb99fb4846b5739e4f1bae3961be238be3d9c49ea40f930
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.5.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