Curl

Roar provides a wrapper around libcurl. The most important object is the Curl::Request. With that you can build requests and “curl_perform” them. Reference the doxygen documentation for details, but here is an example:

Curl::Request
 1#include <roar/curl/request.hpp>
 2#include <iostream>
 3
 4int main()
 5{
 6    std::string responseBody;
 7    const auto response = Roar::Curl::Request{}
 8        .sink(responseBody)
 9        .verbose()
10        .setHeader("Content-Type", "text/plain")
11        .source("Hi")
12        .post("https://localhost:8080")
13    ;
14
15    std::cout << responseBody << "\n";
16    return response.code();
17}