9 #ifndef INCLUDE_FUNAPI_NETWORK_CURL_H_ 10 #define INCLUDE_FUNAPI_NETWORK_CURL_H_ 12 #include <curl/curl.h> 20 class FUNAPI_DLL_VISIBILITY
Curl :
private boost::noncopyable {
24 typedef function<void(CURLcode, const string &error_desc)> CompleteCallback;
28 CURL *easy_handle()
const;
30 void set_complete_callback(
const CompleteCallback &cb);
32 bool GetVerbose()
const;
33 void SetVerbose(
bool on);
35 void SetTimeout(
size_t timeout_in_ms);
37 CURLcode GetResultCode()
const;
38 const char *GetErrorBuffer()
const;
48 class FUNAPI_DLL_VISIBILITY
CurlHttp :
private boost::noncopyable {
52 typedef function<void(CURLcode, const string &error_desc)> CompleteCallback;
53 typedef function<void(void *, size_t)> HeaderReceiveCallback;
54 typedef function<void(void *, size_t)> PayloadReceiveCallback;
58 CURL *easy_handle()
const;
60 void set_complete_callback(
const CompleteCallback &cb);
61 void set_header_receive_callback(
const HeaderReceiveCallback &cb);
62 void set_payload_receive_callback(
const PayloadReceiveCallback &cb);
64 bool GetVerbose()
const;
65 void SetVerbose(
bool on);
66 void SetTimeout(
size_t timeout_in_ms);
68 CURLcode GetResultCode()
const;
69 const string &GetResult()
const;
70 const char *GetErrorBuffer()
const;
72 const string &GetUrl()
const;
74 void SetUrl(
const string &url);
75 void SetUserAgent(
const string &user_agent);
80 void SetPost(
const Ptr<const string> &data);
81 void SetPost(
const curl_httppost *data);
82 void SetPost(
const Json &data);
84 void SetPut(
const Ptr<const string> &data);
85 void SetPut(
const Json &data);
87 void SetDelete(
const Ptr<const string> &data);
88 void SetDelete(
const Json &data);
99 #endif // INCLUDE_FUNAPI_NETWORK_CURL_H_
std::multimap< string, string, impl::util::CaseInsensitiveLess > Header
Datastructure to hold http header fields.
Definition: http_util.h:23