summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connection.cpp7
-rw-r--r--src/curl_wrapper.cpp8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 9cde7d3..3a10d14 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -75,6 +75,13 @@ answer_type Connection::put(const endpoint_variant &endpoint,
endpoint_to_uri(endpoint), parameters);
}
+answer_type Connection::del(const endpoint_variant &endpoint,
+ const parametermap &parameters)
+{
+ return make_request(http_method::DELETE,
+ endpoint_to_uri(endpoint), parameters);
+}
+
string Connection::get_new_stream_contents()
{
buffer_mutex.lock();
diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp
index 7b2b352..6b62389 100644
--- a/src/curl_wrapper.cpp
+++ b/src/curl_wrapper.cpp
@@ -139,8 +139,16 @@ answer_type CURLWrapper::make_request(const http_method &method, string uri,
}
case http_method::DELETE:
{
+ 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, "DELETE");
+
break;
}
}