| 336 | } |
| 337 | |
| 338 | void 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 | |
| 353 | int 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); |
no test coverage detected