36std::expected<Response, std::string>
httpGet(
const std::string& url,
37 std::chrono::seconds
timeout = std::chrono::seconds{
46std::expected<Response, std::string>
httpPost(
const std::string& url,
const std::string& body,
47 const std::string& contentType,
48 std::chrono::seconds
timeout = std::chrono::seconds{
Holds libcurl's process-wide state for the lifetime of one instance.
Definition http_client.h:58
HttpGlobal(HttpGlobal &&)=delete
~HttpGlobal()
Definition http_client.cc:97
HttpGlobal & operator=(const HttpGlobal &)=delete
HttpGlobal & operator=(HttpGlobal &&)=delete
HttpGlobal()
Definition http_client.cc:95
HttpGlobal(const HttpGlobal &)=delete
Definition http_client.cc:10
std::expected< Response, std::string > httpPost(const std::string &url, const std::string &body, const std::string &contentType, std::chrono::seconds timeout)
Performs a blocking POST.
Definition http_client.cc:69
std::expected< Response, std::string > httpGet(const std::string &url, std::chrono::seconds timeout)
Performs a blocking GET.
Definition http_client.cc:57
std::chrono::milliseconds timeout
Definition somanet_procedures.cc:438
What the server answered.
Definition http_client.h:26
std::string body
Response body, however long, exactly as received.
Definition http_client.h:28
int status
HTTP status code, as the server sent it.
Definition http_client.h:27