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 | |
---|---|---|---|
0.10.7 | 323 | 12/22/2021 | |
0.10.6 | 227 | 12/21/2021 | |
0.10.5 | 260 | 12/16/2021 | |
0.10.4 | 508 | 11/20/2021 | |
0.10.1 | 381 | 10/11/2021 | |
0.10.0 | 8,776 | 10/8/2021 | |
0.9.5 | 321 | 10/7/2021 | |
0.9.4 | 1,448 | 10/7/2021 | |
0.9.2 | 353 | 9/19/2021 | |
0.9.1 | 7,385 | 9/18/2021 | |
0.8.0 | 4,310 | 9/11/2021 | |
0.7.4 | 316 | 9/8/2021 | |
0.7.2 | 401 | 9/3/2021 | |
0.7.1 | 400 | 9/3/2021 | |
0.6.1 | 7,956 | 8/30/2021 | |
0.6.0 | 450 | 8/29/2021 | |
0.5.6 | 433 | 8/28/2021 | |
0.5.5 | 436 | 8/18/2021 | |
0.5.4 | 448 | 8/18/2021 | |
0.5.3 | 405 | 8/17/2021 | |
0.5.2 | 407 | 8/16/2021 | |
0.5.1 | 480 | 8/15/2021 | |
0.5.0 | 459 | 8/14/2021 | |
0.4.2 | 414 | 8/13/2021 | |
0.3.0 | 443 | 8/12/2021 | |
0.2.2 | 435 | 8/11/2021 | |
0.2.1 | 430 | 8/11/2021 |
Documentation at https://siddiqsoft.github.io/restcl/html/index.html