SiddiqSoft.restcl
2.3.13
dotnet add package SiddiqSoft.restcl --version 2.3.13
NuGet\Install-Package SiddiqSoft.restcl -Version 2.3.13
<PackageReference Include="SiddiqSoft.restcl" Version="2.3.13" />
<PackageVersion Include="SiddiqSoft.restcl" Version="2.3.13" />
<PackageReference Include="SiddiqSoft.restcl" />
paket add SiddiqSoft.restcl --version 2.3.13
#r "nuget: SiddiqSoft.restcl, 2.3.13"
#:package SiddiqSoft.restcl@2.3.13
#addin nuget:?package=SiddiqSoft.restcl&version=2.3.13
#tool nuget:?package=SiddiqSoft.restcl&version=2.3.13
restcl: A Focused REST Client for Modern C++
restcl is a header-only Modern C++23 REST client library designed with nlohmann::json as a first-class API metaphor for interacting with RESTful servers.
- Cross-Platform Native IO: Uses native
WinHTTPon Windows (WinHttpRESTClient) andlibcurlon Linux/macOS (HttpRESTClient). - Factory Function:
siddiqsoft::GetRESTClient()automatically returns the optimal client instance for the target platform. - Expressive Request Syntax: Native user-defined literals like
"https://api.example.com/endpoint"_GET. - JSON-First API: Request headers, parameters, and bodies are represented as
nlohmann::jsonobjects.
Documentation Site
Full guides, tutorials, API specifications, and interactive dependency graphs are hosted on our documentation site:
- 🚀 Features & Usage: User-defined literals, JSON API metaphor, async callbacks.
- 📦 Integration & CMake:
add_subdirectory, CPM, FetchContent, build options, testing. - 📊 Dependency Graph: Automated visual dependency diagram and version matrix.
- 📖 API Reference: Specifications for
GetRESTClient,rest_request,rest_response, and client classes. - 💡 Examples: Standalone applications including the Cosmos Probes service health probe.
Quick Start
#include "siddiqsoft/restcl.hpp"
using namespace siddiqsoft;
using namespace siddiqsoft::restcl_literals;
int main()
{
// Instantiates WinHttpRESTClient on Windows or HttpRESTClient on Linux/macOS
auto client = GetRESTClient({
{"userAgent", "my-app/1.0"},
{"timeout", 5000}
});
// 1. Simple GET request using literal operator
auto response = client->send("https://httpbin.org/get"_GET);
if (response && response->success()) {
std::cout << "Response body: " << response->content->body << std::endl;
}
// 2. POST request with custom headers and JSON body
auto req = "https://httpbin.org/post"_POST;
req.headers["X-Custom-Header"] = "my-header-value";
req.setContent({ {"name", "Modern C++"}, {"version", 23} });
auto postResponse = client->send(req);
if (postResponse && postResponse->success()) {
std::cout << "Status: " << postResponse->statusCode() << std::endl;
}
return 0;
}
Integration
Using CPM / FetchContent
CPMAddPackage("gh:SiddiqSoft/restcl#2.3.12")
target_link_libraries(${PROJECT_NAME} INTERFACE siddiqsoft::restcl)
Git Submodule
git submodule add https://github.com/SiddiqSoft/restcl.git vendor/restcl
add_subdirectory(vendor/restcl)
target_link_libraries(your_target PRIVATE siddiqsoft::restcl)
For full setup guides and NuGet usage, view the Integration Guide.
Requirements & Building
| Requirement | Details |
|---|---|
| Language Standard | C++23 (/std:c++latest on MSVC, -std=c++23 on Clang/GCC) |
| Platforms | Windows (MSVC 2022+), Linux (GCC 11+, Clang 13+), macOS (Apple Clang 13+) |
| Dependencies | nlohmann/json, SplitUri, AzureCppUtils, ctre |
Building with CMake Presets
# Configure with a preset matching your OS/compiler (e.g. Darwin, Linux-GCC, Windows-x64)
cmake --preset Darwin
# Build target
cmake --build --preset Darwin
# Run test suite
ctest --preset Darwin
License
Licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| native | native is compatible. |
-
- nlohmann.json (>= 3.12.0)
- SiddiqSoft.acw32h (>= 2.7.0)
- SiddiqSoft.arrp (>= 1.2.0)
- SiddiqSoft.asynchrony (>= 2.3.0)
- SiddiqSoft.AzureCppUtils (>= 3.3.0)
- SiddiqSoft.RWLEnvelope (>= 1.5.3)
- SiddiqSoft.SplitUri (>= 3.0.3)
- SiddiqSoft.string2map (>= 2.6.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on SiddiqSoft.restcl:
| Package | Downloads |
|---|---|
|
SiddiqSoft.CosmosClient
Azure Cosmos REST-API Client for Modern C++ |
|
|
SiddiqSoft.log2seq
PROJECTDESCRIPTION |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.13 | 62 | 8/13/2026 |
| 2.3.12 | 59 | 8/12/2026 |
| 2.3.11 | 65 | 8/12/2026 |
| 2.3.10 | 74 | 8/11/2026 |
| 2.3.9 | 82 | 8/11/2026 |
| 2.3.8 | 80 | 8/10/2026 |
| 2.3.7 | 186 | 6/10/2026 |
| 2.3.6 | 310 | 6/3/2026 |
| 2.3.5 | 242 | 5/22/2026 |
| 2.3.4 | 223 | 5/19/2026 |
| 2.3.3 | 214 | 5/18/2026 |
| 2.3.2 | 209 | 5/18/2026 |
| 2.3.1 | 213 | 5/18/2026 |
| 2.2.1 | 217 | 5/16/2026 |
| 2.1.0 | 235 | 5/1/2026 |
| 2.0.3 | 273 | 4/29/2026 |
| 2.0.2 | 232 | 4/28/2026 |
| 1.6.5 | 624 | 12/17/2024 |
| 1.6.4 | 573 | 12/13/2024 |
| 1.6.3 | 584 | 12/12/2024 |
Documentation at https://siddiqsoft.github.io/restcl