File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,15 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
73
73
curl.easy_setopt (handle, CURLOPT_URL, req.url .c_str ());
74
74
curl.easy_setopt (handle, CURLOPT_FOLLOWLOCATION, 1L );
75
75
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
+
76
83
if (req.postdata .size () > 0 && (req.method != " GET" && req.method != " HEAD" ))
77
84
{
78
- // curl.easy_setopt(handle, CURLOPT_POST, 1L);
79
- curl.easy_setopt (handle, CURLOPT_CUSTOMREQUEST, req.method .c_str ());
80
85
curl.easy_setopt (handle, CURLOPT_POSTFIELDS, req.postdata .c_str ());
81
86
curl.easy_setopt (handle, CURLOPT_POSTFIELDSIZE, req.postdata .size ());
82
87
}
You can’t perform that action at this time.
0 commit comments