Skip to content

Commit d05fd9b

Browse files
committed
Attempt to fix cURL backend.
1 parent 43284ed commit d05fd9b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/generic/CurlClient.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,15 @@ 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 == "PUT")
77+
curl.easy_setopt(handle, CURLOPT_PUT, 1L);
78+
else if (req.method == "POST")
79+
curl.easy_setopt(handle, CURLOPT_POST, 1L);
80+
else
81+
curl.easy_setopt(handle, CURLOPT_CUSTOMREQUEST, req.method.c_str());
82+
7683
if (req.postdata.size() > 0 && (req.method != "GET" && req.method != "HEAD"))
7784
{
78-
//curl.easy_setopt(handle, CURLOPT_POST, 1L);
79-
curl.easy_setopt(handle, CURLOPT_CUSTOMREQUEST, req.method.c_str());
8085
curl.easy_setopt(handle, CURLOPT_POSTFIELDS, req.postdata.c_str());
8186
curl.easy_setopt(handle, CURLOPT_POSTFIELDSIZE, req.postdata.size());
8287
}

0 commit comments

Comments
 (0)