add HttpRequest::verifySSL

This commit is contained in:
MihailRis 2026-09-10 21:08:12 +03:00
parent 0608a9ad3d
commit effa850337
2 changed files with 4 additions and 1 deletions

View file

@ -71,10 +71,12 @@ public:
hs = curl_slist_append(hs, header.c_str());
}
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request.body.length());
if (!request.body.empty()) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request.body.length());
curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, request.body.data());
}
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, request.verifySSL);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, request.verifySSL);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, hs);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, request.followLocation);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);