Allow HTTP POST without parameters.
This commit is contained in:
parent
108aeea771
commit
cb7019a0fd
|
@ -101,10 +101,17 @@ answer_type CURLWrapper::make_request(const http_method &method, string uri,
|
||||||
}
|
}
|
||||||
case http_method::POST:
|
case http_method::POST:
|
||||||
{
|
{
|
||||||
curl_mime *mime{parameters_to_curl_mime(uri, parameters)};
|
if (parameters.empty())
|
||||||
|
{
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||||
code = curl_easy_setopt(_connection, CURLOPT_MIMEPOST, mime);
|
code = curl_easy_setopt(_connection, CURLOPT_POST, 1L);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curl_mime *mime{parameters_to_curl_mime(uri, parameters)};
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||||
|
code = curl_easy_setopt(_connection, CURLOPT_MIMEPOST, mime);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue