Skip to content

ZLink HTTP Client For C++ — User Guide

⚠️ This guide is not current. The only guide that has finished review and upkeep right now is the .NET guide. This document reflects an earlier state, and once the .NET guide is finished, this document will be deleted and rewritten based on it.

When confirming the contract, don't trust this document — check the spec tree.

zlink::http_client is a general-purpose HTTP client for sending HTTP requests from C++. It is used with a zlink-style fluent builder, and the public header does not expose Boost.Beast/Asio/OpenSSL types.

#include <zlink/http_client.hpp>

auto game = zlink::http_client::client_t::create ("https://game-api.example.internal")
              .post ("/games")
              .body (create_game_http_req_t{.game_name = "ranked-match-0611"})
              .fetch<create_game_http_res_t> ();

Table Of Contents

Chapter Document Content
1 Overview Design philosophy, deliverable boundary, execution model
2 Getting Started CMake integration, first request, one-line request
3 Client Configuration Builder options, client reuse, connection pool
4 Making Requests HTTP methods, query parameters, headers, request timeout
5 Request Body JSON DTO, raw, form, multipart, streaming upload
6 Handling Responses Result/envelope structure, submit/fetch, status handling
7 Async And Coroutines task_t, co_await, callbacks, blocking rules
8 Streaming download(sink) download, chunked upload
9 Authentication And TLS Basic/Bearer, HTTPS verification, mTLS
10 Redirect · Retry · Cookie Redirect semantics, retry policy, cookie jar
11 Proxy HTTP proxy, CONNECT tunnel, proxy authentication
12 Compression Transparent gzip/deflate decoding
13 Error Handling Error kind mapping, retriable, exception paths

Quick Guide

The formal contract and regression test axes are owned by the spec document cpp-http-client.ko.md. This guide covers usage.