9 #ifndef INCLUDE_FUNAPI_NETWORK_HTTP_CLIENT_POOL_H_ 10 #define INCLUDE_FUNAPI_NETWORK_HTTP_CLIENT_POOL_H_ 25 typedef std::map<
string ,
string > HeaderMap;
27 static const HeaderMap kNullHeader;
29 static void GetAsync(
const string &url,
const Handler &handler,
30 size_t timeout_in_ms = 0);
31 static void GetAsync(
const string &url,
const HeaderMap &headers,
32 const Handler &handler,
size_t timeout_in_ms = 0);
34 static void PostAsync(
const string &url,
const Ptr<const string> &data,
35 const Handler &handler,
size_t timeout_in_ms = 0);
36 static void PostAsync(
const string &url,
const Json &data,
37 const Handler &handler,
size_t timeout_in_ms = 0);
38 static void PostAsync(
const string &url,
const curl_httppost *data,
39 const Handler &handler,
size_t timeout_in_ms = 0);
40 static void PostAsync(
const string &url,
const HeaderMap &headers,
41 const Ptr<const string> &data,
42 const Handler &handler,
size_t timeout_in_ms = 0);
43 static void PostAsync(
const string &url,
const HeaderMap &headers,
44 const Json &data,
const Handler &handler,
45 size_t timeout_in_ms = 0);
46 static void PostAsync(
const string &url,
const HeaderMap &headers,
47 const curl_httppost *data,
const Handler &handler,
48 size_t timeout_in_ms = 0);
50 static void PutAsync(
const string &url,
const Ptr<const string> &data,
51 const Handler &handler,
size_t timeout_in_ms = 0);
52 static void PutAsync(
const string &url,
const Json &data,
53 const Handler &handler,
size_t timeout_in_ms = 0);
54 static void PutAsync(
const string &url,
const HeaderMap &headers,
55 const Ptr<const string> &data,
56 const Handler &handler,
size_t timeout_in_ms = 0);
57 static void PutAsync(
const string &url,
const HeaderMap &headers,
58 const Json &data,
const Handler &handler,
59 size_t timeout_in_ms = 0);
61 static void DeleteAsync(
const string &url,
const Ptr<const string> &data,
62 const Handler &handler,
size_t timeout_in_ms = 0);
63 static void DeleteAsync(
const string &url,
const Json &data,
64 const Handler &handler,
size_t timeout_in_ms = 0);
65 static void DeleteAsync(
const string &url,
const HeaderMap &headers,
66 const Ptr<const string> &data,
const Handler &handler,
67 size_t timeout_in_ms = 0);
68 static void DeleteAsync(
const string &url,
const HeaderMap &headers,
69 const Json &data,
const Handler &handler,
70 size_t timeout_in_ms = 0);
73 static CURLcode Get(
const string &url,
const HeaderMap &headers,
76 static CURLcode Post(
const string &url,
const Ptr<const string> &data,
78 static CURLcode Post(
const string &url,
const Json &data,
80 static CURLcode Post(
const string &url,
const curl_httppost *data,
82 static CURLcode Post(
const string &url,
const HeaderMap &headers,
83 const Ptr<const string> &data,
85 static CURLcode Post(
const string &url,
const HeaderMap &headers,
87 static CURLcode Post(
const string &url,
const HeaderMap &headers,
90 static CURLcode Put(
const string &url,
const Ptr<const string> &data,
92 static CURLcode Put(
const string &url,
const Json &data,
94 static CURLcode Put(
const string &url,
const HeaderMap &headers,
95 const Ptr<const string> &data,
97 static CURLcode Put(
const string &url,
const HeaderMap &headers,
100 static CURLcode Delete(
const string &url,
const Json &data,
102 static CURLcode Delete(
const string &url,
const Ptr<const string> &data,
104 static CURLcode Delete(
const string &url,
const HeaderMap &headers,
106 static CURLcode Delete(
const string &url,
const HeaderMap &headers,
107 const Ptr<const string> &data,
110 static size_t GetSize(
const string &host);
112 static void GetSizeAll(
113 std::vector<std::pair<string/*host*/, size_t/*size*/> > *out);
119 #endif // INCLUDE_FUNAPI_NETWORK_HTTP_CLIENT_POOL_H_
function< void(const CURLcode, const http::Response &)> Handler
Handler type for asynchronous operations.
Definition: http_client.h:34
Data structure to hold HTTP response.
Definition: http_util.h:137
Definition: http_client_pool.h:22