File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments