Fix: clear reponse text before doing curl request

Response text is appended to whatever is in _text, so that should be
cleared before every request.
This commit is contained in:
Bob Polis 2024-03-31 11:53:47 +02:00
parent 14c7aed560
commit 6232f9d593

View File

@ -74,6 +74,7 @@ std::string requester::post(const std::string& url, const std::string& json) {
curl_easy_setopt(_h.get(), CURLOPT_HTTPHEADER, headers); curl_easy_setopt(_h.get(), CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(_h.get(), CURLOPT_WRITEDATA, this); curl_easy_setopt(_h.get(), CURLOPT_WRITEDATA, this);
_text = "";
auto success = curl_easy_perform(_h.get()); auto success = curl_easy_perform(_h.get());
if (success != CURLE_OK) { if (success != CURLE_OK) {
std::ostringstream oss; std::ostringstream oss;