C++ Requests library using Boost
This project is maintained by Y77CHâ„¢
cq == C++ Requests is a Python Requests like library for sending HTTP requests. The library is inspired a lot by the Cpr project, yet uses Boost instead of cURL. We aim for most simple workflow with both HTTP and HTTPS protocols.
Sending a GET
request is nothing more than:
#include <cq/requests.hpp>
int main()
{
Requests::Response 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;
}
C++ Requests currently supports:
The following features will be added in next releases:
And more!
Requests deliberately uses most modern C++20
features, hence it requires lastest versions of compilers.
It also requires:
Boost
OpenSSL
sudo apt-get install libboost-dev openssl
git clone https://github.com/Y77CH/cq
mkdir build
cd build
cmake ..
cmake --build .
cmake --install .
Please fork this repository and contribute back using pull requests. Features can be requested using issues. All code, comments, and critiques are greatly appreciated.