A minimal C++ example showing how to use cpp-httplib over HTTPS with openssl-shim.
The demo performs a GET request to:
https://www.howsmyssl.com/a/check
and prints the response body.
- CMake 3.15+
- A C++ compiler with C++11 support or newer
- Internet access during configure/build (dependencies are fetched with CMake
FetchContent)
cmake -S . -B build
cmake --build build./build/httplib_exampleOn Windows with multi-config generators (Visual Studio), run the executable from the config folder, for example:
.\build\Debug\httplib_example.exesrc/httplib_example.cpp— example client codecmake.toml— cmkr project definitionCMakeLists.txt— generated CMake file
CMakeLists.txtis generated fromcmake.tomlvia cmkr.- Dependencies are pinned as follows:
cpp-httplib:v0.33.1openssl_shim:master