ADD: changed the way of retreiving the result from the curl request
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user