mcpp index

mcpplibs.tinyhttps

import

Minimal C++23 HTTP/HTTPS client with SSE streaming support

import mcpplibs.tinyhttps;

Module name read from the upstream `export module` declaration in src/tinyhttps.cppm.

mcpp add mcpplibs.tinyhttps@0.2.9

Usage

From this repository's own test project — built and run by CI, not written for the website.

import std;
import mcpplibs.tinyhttps;

int main() {
    using namespace mcpplibs::tinyhttps;

    const auto request = HttpRequest::post("https://example.invalid/data", "{\"ok\":true}");
    const auto proxy = parse_proxy_url("http://127.0.0.1:8088/path");
    const auto chunk = parse_chunk_size_line("1a");
    const auto invalid_chunk = parse_chunk_size_line("1x");

    HttpResponse response{204, "No Content", {}, {}};
    const bool ok = request.method == Method::POST
                 && request.url == "https://example.invalid/data"
                 && request.body == "{\"ok\":true}"
                 && request.headers.at("Content-Type") == "application/json"
                 && proxy.host == "127.0.0.1"
                 && proxy.port == 8088
                 && chunk == 26
                 && !invalid_chunk.has_value()
                 && response.ok();
    return ok ? 0 : 1;
// …

tests/examples/tinyhttps/tests/api.cpp · project tests/examples/tinyhttps

Build · upstream manifest

modules
mcpplibs.tinyhttps
targets
tinyhttps (lib)
manifest version
0.2.9
dependencies
compat
source
https://raw.githubusercontent.com/mcpplibs/tinyhttps/0.2.9/mcpp.toml

Versions

VersionPlatforms Mirrorssha256
0.2.9 latest LinuxWindowsmacOS GLOBAL CN b17e0b15d2c2…
0.2.8 LinuxWindowsmacOS GLOBAL CN a3d72396b267…
0.2.7 LinuxWindowsmacOS GLOBAL CN c8444d0974e8…
0.2.6 LinuxWindowsmacOS GLOBAL CN 5e0bbc4b7f20…
0.2.5 LinuxWindowsmacOS GLOBAL CN 87084c23d151…
Show all 9 versions
0.2.4 LinuxWindowsmacOS GLOBALCN e9aa33ca770b…
0.2.3 LinuxWindowsmacOS GLOBALCN 67ff75050d31…
0.2.2 LinuxWindowsmacOS GLOBALCN bc4cb5947582…
0.2.1 LinuxWindowsmacOS GLOBALCN 88adc68b1c1e…