ADD: changed the way of retreiving the result from the curl request
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <fstream>
|
||||
#include <curlpp/Easy.hpp>
|
||||
#include <curlpp/Options.hpp>
|
||||
#include <kubecontrol/WriterMemoryClass.hpp>
|
||||
#include <loguru.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#define MAX_FILE_LENGTH 200000
|
||||
|
||||
class WriterMemoryClass
|
||||
{
|
||||
public:
|
||||
|
||||
// Callback must be declared static, otherwise it won't link...
|
||||
size_t WriteMemoryCallback(char* ptr, size_t size, size_t nmemb)
|
||||
{
|
||||
str_pBuffer.erase();
|
||||
str_pBuffer = std::string(ptr);
|
||||
|
||||
return str_pBuffer.size();
|
||||
};
|
||||
|
||||
std::string getResponse()
|
||||
{
|
||||
// return std::string(m_pBuffer);
|
||||
return str_pBuffer;
|
||||
}
|
||||
|
||||
void print()
|
||||
{
|
||||
std::cout << "Size: " << str_pBuffer.size() << std::endl;
|
||||
std::cout << "Content: " << std::endl << str_pBuffer << std::endl;
|
||||
}
|
||||
|
||||
// Public member vars
|
||||
private:
|
||||
std::string str_pBuffer;
|
||||
};
|
||||
Reference in New Issue
Block a user