SiddiqSoft.restcl
0.7.2
See the version list below for details.
dotnet add package SiddiqSoft.restcl --version 0.7.2
NuGet\Install-Package SiddiqSoft.restcl -Version 0.7.2
<PackageReference Include="SiddiqSoft.restcl" Version="0.7.2" />
paket add SiddiqSoft.restcl --version 0.7.2
#r "nuget: SiddiqSoft.restcl, 0.7.2"
// Install SiddiqSoft.restcl as a Cake Addin #addin nuget:?package=SiddiqSoft.restcl&version=0.7.2 // Install SiddiqSoft.restcl as a Cake Tool #tool nuget:?package=SiddiqSoft.restcl&version=0.7.2
restcl : A focused REST Client for Modern C++
Objective
Design a library where JSON is a first-class API metaphor for interacting with RESTful servers.
Focused on REST interactions with JSON. Limiting allows us to simplify the usage and make it feel very C++ instead of the C-like API of Win32 or OpenSSL.
Modern C++ features: C++20 is required!
Header only
Use native implementations for the actual IO: Windows support uses WinHttp library.
- Initial implementation is for Windows using WinHTTP.
- Alternate implementation using OpenSSL tbd.
Support for literals to allow
_GET
,_DELETE
, etc.Support for std::format and concepts.
Be instructional and use as little code as necessary.
The focus is on the interface to the end user.
Performance is not the objective.
Simplicity (hide the underlying implementation)
#include "siddiqsoft/restcl.hpp" #include "siddiqsoft/restcl_winhttp.hpp" ... using namespace siddiqsoft; using namespace siddiqsoft::literals; WinHttpRESTClient wrc("my-user-agent-string"); // optional UA; defaults to siddiqsoft.restcl/version // Create a simple GET request from the endpoint string // Send the request and invoke the callback. wrc.send( "https://google.com"_GET, [](const auto& req, const auto& resp) { if(resp.success()) doSomething(); }); ... ... // Create a POST request by parsing out the string auto myPost= "https://server:999/path?q=hello-world"_POST; // Add custom header myPost["headers"]["X-MyHeader"]= "my-header-value"; // Adds the content with supplied json object and sets the // headers Content-Length and Content-Type myPost.setContent( {{"foo", "bar"}, {"goto", 99}} ); // Send the request and invoke the callback wrc.send( std::move(myReq), [](auto& req, auto& resp){ if(resp.success()) doSomething(); else logError(resp.error()); });
Product | Versions Compatible and additional computed target framework versions. |
---|---|
native | native is compatible. |
-
- nlohmann.json (>= 3.10.0)
- SiddiqSoft.acw32h (>= 2.0.0)
- SiddiqSoft.AzureCppUtils (>= 1.0.0)
- SiddiqSoft.SplitUri (>= 1.7.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SiddiqSoft.restcl:
Package | Downloads |
---|---|
SiddiqSoft.CosmosClient
Azure Cosmos REST-API Client for Modern C++ |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.5.2.4 | 95 | 10/28/2024 | |
1.5.2 | 93 | 10/25/2024 | |
1.5.1 | 125 | 10/4/2024 | |
0.10.13 | 91 | 10/2/2024 | |
0.10.12 | 89 | 10/2/2024 | |
0.10.11 | 89 | 10/2/2024 | |
0.10.10 | 82 | 10/1/2024 | |
0.10.9 | 81 | 9/28/2024 | |
0.10.8 | 82 | 9/28/2024 | |
0.10.7 | 356 | 12/22/2021 | |
0.10.6 | 247 | 12/21/2021 | |
0.10.5 | 288 | 12/16/2021 | |
0.10.4 | 529 | 11/20/2021 | |
0.10.1 | 402 | 10/11/2021 | |
0.10.0 | 8,905 | 10/8/2021 | |
0.9.5 | 342 | 10/7/2021 | |
0.9.4 | 1,489 | 10/7/2021 | |
0.9.2 | 381 | 9/19/2021 | |
0.9.1 | 7,499 | 9/18/2021 | |
0.8.0 | 4,394 | 9/11/2021 | |
0.7.4 | 336 | 9/8/2021 | |
0.7.2 | 425 | 9/3/2021 | |
0.7.1 | 424 | 9/3/2021 | |
0.6.1 | 8,074 | 8/30/2021 | |
0.6.0 | 476 | 8/29/2021 | |
0.5.6 | 462 | 8/28/2021 | |
0.5.5 | 460 | 8/18/2021 | |
0.5.4 | 474 | 8/18/2021 | |
0.5.3 | 428 | 8/17/2021 | |
0.5.2 | 432 | 8/16/2021 | |
0.5.1 | 510 | 8/15/2021 | |
0.5.0 | 482 | 8/14/2021 | |
0.4.2 | 437 | 8/13/2021 | |
0.3.0 | 470 | 8/12/2021 | |
0.2.2 | 453 | 8/11/2021 | |
0.2.1 | 453 | 8/11/2021 |
Documentation at https://siddiqsoft.github.io/restcl/html/index.html