@@ -155,30 +155,21 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
155155
156156 curl.easy_setopt (handle, CURLOPT_URL, req.url .c_str ());
157157 curl.easy_setopt (handle, CURLOPT_FOLLOWLOCATION, 1L );
158-
159- std::string method = req.method ;
160- if (method.empty ())
161- method = req.postdata .size () > 0 ? " POST" : " GET" ;
162- else
163- std::transform (method.begin (), method.end (), method.begin (), toUppercase);
164- curl.easy_setopt (handle, CURLOPT_CUSTOMREQUEST, method.c_str ());
158+ curl.easy_setopt (handle, CURLOPT_CUSTOMREQUEST, req.method .c_str ());
165159
166160 StringReader reader {};
167161
168- if (req.postdata .size () > 0 && (method != " GET" && method != " HEAD" ))
162+ if (req.postdata .size () > 0 && (req. method != " GET" && req. method != " HEAD" ))
169163 {
170164 reader.str = &req.postdata ;
171165 reader.pos = 0 ;
172166 curl.easy_setopt (handle, CURLOPT_UPLOAD, 1L );
173167 curl.easy_setopt (handle, CURLOPT_READFUNCTION, stringReader);
174168 curl.easy_setopt (handle, CURLOPT_READDATA, &reader);
175169 curl.easy_setopt (handle, CURLOPT_INFILESIZE_LARGE, (curl_off_t ) req.postdata .length ());
176-
177- if (newHeaders.count (" Content-Type" ) == 0 )
178- newHeaders[" Content-Type" ] = " application/x-www-form-urlencoded" ;
179170 }
180171
181- if (method == " HEAD" )
172+ if (req. method == " HEAD" )
182173 curl.easy_setopt (handle, CURLOPT_NOBODY, 1L );
183174
184175 // Curl doesn't copy memory, keep the strings around
0 commit comments