2 * @brief HTTPHelper class header. This class represents a Helper to perform HTTP operations easily.
6 * @copyright Intra2net AG
15 #include <boost/shared_ptr.hpp>
16 #include <curl/curl.h>
28 CURLcode CurlInitError;
30 std::string CurlWritedataBuff;
31 std::string ReceivedCurlData;
32 char CurlErrBuff[CURL_ERROR_SIZE];
36 CURLcode set_curl_url(const std::string& url);
37 CURLcode set_curl_auth(const std::string& username, const std::string& password);
38 CURL* init_curl(std::string& curl_writedata_buff, char* curl_err_buff);
42 typedef boost::shared_ptr<HTTPHelper> Ptr;
46 HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port, const std::string& _username, const std::string& _password);
48 HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port);
52 long http_get(const std::string& ip);
54 std::string get_curl_data() const;
56 bool is_initialized() const;
60 // libcurl is a C library, so we have to make the callback member function static :-(
61 static size_t http_receive(const char *inBuffer, size_t size, size_t nmemb, std::string *outBuffer);