An open API service indexing awesome lists of open source software.

https://github.com/dax89/crequests

A simple CURL based HTTP Client for C++17
https://github.com/dax89/crequests

cplusplus cplusplus-17 http-client

Last synced: 3 months ago
JSON representation

A simple CURL based HTTP Client for C++17

Awesome Lists containing this project

README

          

# CRequests

CRequests is a simple synchronous CURL based HTTP Client, this library is inspired by the famous Python [requests](https://docs.python-requests.org/en/latest/) module.

# Usage
```cpp
#include
#include

int main() {
auto response = CRequests::post("https://example.com/todo", {
{"field1", "value"},
{"field2", 42}
});

if(response.statusCode() == 200)
std::cout << "OK, response is: " << response.text() << std::endl;
else
std::cout << "ERROR, status code: " << response.statusCode() << std::endl;

return 0;
}
```

### Requirements & Support
* A C++17 capable compiler
* Tested on Windows 10 and Linux