ADD: changed the way of retreiving the result from the curl request

This commit is contained in:
Henry Winkel
2023-10-27 10:44:57 +02:00
parent 052fe52489
commit be81f87154
7 changed files with 40 additions and 92 deletions

View File

@@ -290,12 +290,11 @@ namespace kubecontrol
auto request = std::make_unique<curlpp::Easy>();
WriterMemoryClass mWriterChunk;
curlpp::types::WriteFunctionFunctor functor = std::bind(&WriterMemoryClass::WriteMemoryCallback, &mWriterChunk, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(functor);
request->setOpt(test);
// request->setOpt(test);
std::stringstream result;
request->setOpt(cURLpp::Options::WriteStream(&result));
request->setOpt(new curlpp::options::HttpHeader(headers));
request->setOpt(new curlpp::options::Url(curlURL));
@@ -306,9 +305,10 @@ namespace kubecontrol
request->perform();
std::string response = mWriterChunk.getResponse();
return response;
// std::string response = mWriterChunk.getResponse();
std::string response = result.str();
return response;
}
void PodController::performForceStopRequest(std::string uuid)