-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add http post feature for HttpClient #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| if(_header_list != nullptr) { | ||
| curl_slist_free_all(_header_list); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_header_list = nullptr
|
|
||
| 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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post_body.data(), post_body.size()
be/src/http/http_client.h
Outdated
|
|
||
| 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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_header_list != nullptr) {
curl_slist_free_all(_header_list);
}
| std::string request_body = "simple post body query"; | ||
| st = client.execute_post_request(request_body, &response); | ||
| ASSERT_TRUE(st.ok()); | ||
| ASSERT_EQ(response.length(), request_body.length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASSERT_STRCMP(.c_str(), .c_str())
apache#773) * Implement drop instance * Fix drop cluster without comparing instance id
No description provided.