diff --git a/cpp/http/HttpClient.cpp b/cpp/http/HttpClient.cpp index ef77407ff7..0617abe25e 100644 --- a/cpp/http/HttpClient.cpp +++ b/cpp/http/HttpClient.cpp @@ -23,6 +23,11 @@ namespace Snowflake { curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, SimpleHttpClient::write); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &response); + if (!req.body.empty()) { + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, req.body.c_str()); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, req.body.size()); + } + struct curl_slist *header_list = nullptr; for (const auto &h: req.headers) { std::string hdr = h.first + ": " + h.second; diff --git a/include/snowflake/HttpClient.hpp b/include/snowflake/HttpClient.hpp index ca73805999..8a9a1b6b2d 100644 --- a/include/snowflake/HttpClient.hpp +++ b/include/snowflake/HttpClient.hpp @@ -45,6 +45,7 @@ namespace Snowflake { boost::urls::url url; std::map headers; + std::string body{}; }; struct HttpClientConfig {