Miku AuahDark пре 3 година
родитељ
комит
a71f602180
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      src/generic/CurlClient.cpp

+ 3 - 2
src/generic/CurlClient.cpp

@@ -73,9 +73,10 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
 	curl.easy_setopt(handle, CURLOPT_URL, req.url.c_str());
 	curl.easy_setopt(handle, CURLOPT_URL, req.url.c_str());
 	curl.easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
 	curl.easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
 
 
-	if (req.method == Request::POST)
+	if (req.postdata.size() > 0 && (req.method != "GET" && req.method != "HEAD"))
 	{
 	{
-		curl.easy_setopt(handle, CURLOPT_POST, 1L);
+		//curl.easy_setopt(handle, CURLOPT_POST, 1L);
+		curl.easy_setopt(handle, CURLOPT_CUSTOMREQUEST, req.method.c_str());
 		curl.easy_setopt(handle, CURLOPT_POSTFIELDS, req.postdata.c_str());
 		curl.easy_setopt(handle, CURLOPT_POSTFIELDS, req.postdata.c_str());
 		curl.easy_setopt(handle, CURLOPT_POSTFIELDSIZE, req.postdata.size());
 		curl.easy_setopt(handle, CURLOPT_POSTFIELDSIZE, req.postdata.size());
 	}
 	}