SiddiqSoft.restcl 2.3.13

dotnet add package SiddiqSoft.restcl --version 2.3.13
                    
NuGet\Install-Package SiddiqSoft.restcl -Version 2.3.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SiddiqSoft.restcl" Version="2.3.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SiddiqSoft.restcl" Version="2.3.13" />
                    
Directory.Packages.props
<PackageReference Include="SiddiqSoft.restcl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SiddiqSoft.restcl --version 2.3.13
                    
#r "nuget: SiddiqSoft.restcl, 2.3.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SiddiqSoft.restcl@2.3.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SiddiqSoft.restcl&version=2.3.13
                    
Install as a Cake Addin
#tool nuget:?package=SiddiqSoft.restcl&version=2.3.13
                    
Install as a Cake Tool

restcl: A Focused REST Client for Modern C++

Build Status alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 WinHTTP on Windows (WinHttpRESTClient) and libcurl on 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::json objects.

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 Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed