Add support for HTTP methods PATCH and DELETE.
This commit is contained in:
parent
270359f719
commit
a77f773c46
@ -38,7 +38,9 @@ using std::string_view;
|
||||
enum class http_method
|
||||
{
|
||||
GET,
|
||||
POST
|
||||
POST,
|
||||
PATCH,
|
||||
DELETE
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -59,6 +59,18 @@ answer_type CURLWrapper::make_request(const http_method &method,
|
||||
code = curl_easy_setopt(_connection, CURLOPT_POST, 1L);
|
||||
break;
|
||||
}
|
||||
case http_method::PATCH:
|
||||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||
code = curl_easy_setopt(_connection, CURLOPT_CUSTOMREQUEST, "PATCH");
|
||||
break;
|
||||
}
|
||||
case http_method::DELETE:
|
||||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||
code = curl_easy_setopt(_connection, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (code != CURLE_OK)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user