imay commented on a change in pull request #773: Add http post feature for
HttpClient
URL: https://github.com/apache/incubator-doris/pull/773#discussion_r266790795
##########
File path: be/src/http/http_client.h
##########
@@ -54,6 +54,17 @@ class HttpClient {
curl_easy_setopt(_curl, CURLOPT_PASSWORD, passwd.c_str());
}
+ void set_content_type(const std::string content_type) {
+ std::string scratch_str = "Content-Type: " + content_type;
+ _header_list = curl_slist_append(NULL, scratch_str.c_str());
+ curl_easy_setopt(_curl, CURLOPT_HTTPHEADER, _header_list);
+ }
+
+ void set_post_body(const std::string& post_body) {
+ curl_easy_setopt(_curl, CURLOPT_POSTFIELDS, post_body.c_str());
+ curl_easy_setopt(_curl, CURLOPT_POSTFIELDSIZE,
(long)post_body.length());
Review comment:
post_body.data(), post_body.size()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]