bakaid commented on a change in pull request #610: MINIFICPP-814 - Fixed 
ListenHTTP and HTTPClient bugs, created tests f…
URL: https://github.com/apache/nifi-minifi-cpp/pull/610#discussion_r302967587
 
 

 ##########
 File path: extensions/http-curl/client/HTTPClient.cpp
 ##########
 @@ -327,7 +356,9 @@ void HTTPClient::set_request_method(const std::string 
method) {
   if (my_method == "POST") {
     curl_easy_setopt(http_session_, CURLOPT_POST, 1L);
   } else if (my_method == "PUT") {
-    curl_easy_setopt(http_session_, CURLOPT_PUT, 0L);
+    curl_easy_setopt(http_session_, CURLOPT_UPLOAD, 1L);
+  } else if (my_method == "HEAD") {
+    curl_easy_setopt(http_session_, CURLOPT_NOBODY, 1L);
 
 Review comment:
   Just passing "HEAD" as the CURLOPT_CUSTOMREQUEST will not work, because curl 
will expect a response body. CURLOPT_NOBODY is the proper way to do it.

----------------------------------------------------------------
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

Reply via email to