#include #include #include #include #include long curlreq(std::stringstream &responsebuffer, std::string SID, std::string URL) { std::cout << "Connection details begin" << std::endl; std::cout << "URL: " << URL << std::endl; std::cout << "SID: " << SID << std::endl; std::cout << "Connection details end" << std::endl; // Initialise variables curlpp::Cleanup cleaner; curlpp::Easy request; // Set the writer callback to enable cURL to write result in a memory area request.setOpt(new curlpp::options::WriteStream(&responsebuffer)); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(URL)); // Set SID cookie std::list header; header.push_back("Cookie: SID=" + SID); request.setOpt(new curlpp::options::HttpHeader(header)); // Perform request request.perform(); // Return result return curlpp::infos::ResponseCode::get(request); }