diff --git a/premake.make b/premake.make index 360aaf3..0bba8fd 100644 --- a/premake.make +++ b/premake.make @@ -2,6 +2,6 @@ LDLIBS := -lcurl -lsclogging -lscterm MAJOR := 1 MINOR := 0 -PATCH := 0 +PATCH := 1 GENERATELIBHEADER := 1 diff --git a/src/requester.cpp b/src/requester.cpp index f080cf1..914d14e 100644 --- a/src/requester.cpp +++ b/src/requester.cpp @@ -1,6 +1,5 @@ #include "requester.hpp" #include -#include #include #include #include @@ -73,9 +72,7 @@ std::string requester::post(const std::string& url, const std::string& json) { headers = curl_slist_append(headers, "Content-Type: application/json"); std::unique_ptr hdrs {headers, curl_slist_free_all}; curl_easy_setopt(_h.get(), CURLOPT_HTTPHEADER, headers); - - std::string response; - curl_easy_setopt(_h.get(), CURLOPT_WRITEDATA, &response); + curl_easy_setopt(_h.get(), CURLOPT_WRITEDATA, this); auto success = curl_easy_perform(_h.get()); if (success != CURLE_OK) { @@ -83,5 +80,5 @@ std::string requester::post(const std::string& url, const std::string& json) { oss << "could not post data: " << curl_easy_strerror(success); throw std::runtime_error {oss.str()}; } - return response; + return _text; }