Skip to content

Commit 4f812f5

Browse files
authored
feat: Utils.cpp to support windows-curl-certificate
1 parent 8532806 commit 4f812f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int postRequest(const std::string &url, const std::string &payload,
3636
}
3737

3838
// Set the URL and payload for the POST request
39+
setCurlPathForWindows(curl);
3940
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
4041
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload.c_str());
4142

@@ -76,6 +77,7 @@ int getRequest(const std::string &url, const std::vector<std::string> &headers,
7677
return -1;
7778
}
7879

80+
setCurlPathForWindows(curl);
7981
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
8082

8183
struct curl_slist *chunk = NULL;
@@ -113,6 +115,7 @@ int putRequest(const std::string &url, const std::string &payload,
113115
}
114116

115117
// Set the URL and payload for the PUT request
118+
setCurlPathForWindows(curl);
116119
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
117120
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
118121
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload.c_str());
@@ -156,6 +159,7 @@ int patchRequest(const std::string &url, const std::string &payload,
156159
}
157160

158161
// Set the URL and payload for the PATCH request
162+
setCurlPathForWindows(curl);
159163
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
160164
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
161165
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload.c_str());
@@ -199,6 +203,7 @@ int deleteRequest(const std::string &url,
199203
}
200204

201205
// Set the URL for the DELETE request
206+
setCurlPathForWindows(curl);
202207
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
203208
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
204209

0 commit comments

Comments
 (0)