summaryrefslogtreecommitdiffstats
path: root/src/curl_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/curl_wrapper.cpp')
-rw-r--r--src/curl_wrapper.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp
index 047b799..7b2b352 100644
--- a/src/curl_wrapper.cpp
+++ b/src/curl_wrapper.cpp
@@ -111,14 +111,30 @@ answer_type CURLWrapper::make_request(const http_method &method, string uri,
}
case http_method::PATCH:
{
+ if (!parameters.empty())
+ {
+ curl_mime *mime{parameters_to_curl_mime(uri, parameters)};
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
+ code = curl_easy_setopt(_connection, CURLOPT_MIMEPOST, mime);
+ }
+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
code = curl_easy_setopt(_connection, CURLOPT_CUSTOMREQUEST, "PATCH");
+
break;
}
case http_method::PUT:
{
+ if (!parameters.empty())
+ {
+ curl_mime *mime{parameters_to_curl_mime(uri, parameters)};
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
+ code = curl_easy_setopt(_connection, CURLOPT_MIMEPOST, mime);
+ }
+
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
- code = curl_easy_setopt(_connection, CURLOPT_UPLOAD, 1L);
+ code = curl_easy_setopt(_connection, CURLOPT_CUSTOMREQUEST, "PUT");
+
break;
}
case http_method::DELETE: