Add support for HTTP methods PATCH and DELETE.

This commit is contained in:
tastytea 2020-01-05 13:59:43 +01:00
parent 270359f719
commit a77f773c46
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 15 additions and 1 deletions

View File

@ -38,7 +38,9 @@ using std::string_view;
enum class http_method
{
GET,
POST
POST,
PATCH,
DELETE
};
/*!

View File

@ -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)
{