Skip to content

Commit a71f602

Browse files
committed
Fix cURL backend compile.
1 parent 1e2bf01 commit a71f602

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/generic/CurlClient.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
7373
curl.easy_setopt(handle, CURLOPT_URL, req.url.c_str());
7474
curl.easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
7575

76-
if (req.method == Request::POST)
76+
if (req.postdata.size() > 0 && (req.method != "GET" && req.method != "HEAD"))
7777
{
78-
curl.easy_setopt(handle, CURLOPT_POST, 1L);
78+
//curl.easy_setopt(handle, CURLOPT_POST, 1L);
79+
curl.easy_setopt(handle, CURLOPT_CUSTOMREQUEST, req.method.c_str());
7980
curl.easy_setopt(handle, CURLOPT_POSTFIELDS, req.postdata.c_str());
8081
curl.easy_setopt(handle, CURLOPT_POSTFIELDSIZE, req.postdata.size());
8182
}

0 commit comments

Comments
 (0)