MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / set_request_method

Method set_request_method

extensions/http-curl/client/HTTPClient.cpp:338–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void HTTPClient::set_request_method(const std::string method) {
339 std::string my_method = method;
340 std::transform(my_method.begin(), my_method.end(), my_method.begin(), ::toupper);
341 if (my_method == "POST") {
342 curl_easy_setopt(http_session_, CURLOPT_POST, 1L);
343 } else if (my_method == "PUT") {
344 curl_easy_setopt(http_session_, CURLOPT_UPLOAD, 1L);
345 } else if (my_method == "HEAD") {
346 curl_easy_setopt(http_session_, CURLOPT_NOBODY, 1L);
347 } else if (my_method == "GET") {
348 } else {
349 curl_easy_setopt(http_session_, CURLOPT_CUSTOMREQUEST, my_method.c_str());
350 }
351}
352
353int HTTPClient::onProgress(void *clientp, curl_off_t /*dltotal*/, curl_off_t dlnow, curl_off_t /*ultotal*/, curl_off_t ulnow){
354 HTTPClient& client = *(HTTPClient*)(clientp);

Callers 2

get_tokenFunction · 0.80
sendPayloadMethod · 0.80

Calls 3

c_strMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected