cq == C++ Requests
is a "Python Requests"-like C++ header-only library for sending HTTP requests. The library is inspired a lot by the Cpr project, yet tries to be even more simple.
Sending a GET
request is nothing more than:
#include "requests.hpp"
int main()
{
auto r = requests::get("https://api.github.com/user", requests::auth{"user", "pass"});
r.status_code; // 200
r.headers["content-type"]; // "application/json; charset=utf8"
r.text; // "{\"type\":\"User\"..."
return 0;
}
Documentation can be found here. Work in progress.
cURL
- Compiler that supports
C++20
Please fork this repository and contribute back using pull requests. Features can be requested using issues. All code, comments, and critiques are greatly appreciated.