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>
29 std::string CurlWritedataBuff;
30 std::string ReceivedCurlData;
31 char CurlErrBuff[CURL_ERROR_SIZE];
33 CURLcode set_curl_url(const std::string& url);
34 CURLcode set_curl_auth(const std::string& username, const std::string& password);
35 CURL* init_curl(std::string& curl_writedata_buff, char* curl_err_buff);
39 typedef boost::shared_ptr<HTTPHelper> Ptr;
43 HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port, const std::string& _username, const std::string& _password);
45 HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port);
49 long http_get(const std::string& ip);
51 std::string get_curl_data() const;
53 bool is_initialized() const;
55 // libcurl is a C library, so we have to make the callback member function static :-(
56 static size_t http_receive(const char *inBuffer, size_t size, size_t nmemb, std::string *outBuffer);