curl :: CurlHTTPRequest :: set_method
attribute and body if the method allows it according to RFC7231
# Set cURL parameters according to assigned HTTP method set in method
# attribute and body if the method allows it according to RFC7231
private fun set_method : CURLCode
do
var err : CURLCode
if self.method=="GET" then
err=self.curl.native.easy_setopt(new CURLOption.get, 1)
else if self.method=="POST" then
err=self.curl.native.easy_setopt(new CURLOption.post, 1)
else if self.method=="HEAD" then
err=self.curl.native.easy_setopt(new CURLOption.no_body,1)
else
err=self.curl.native.easy_setopt(new CURLOption.custom_request,self.method)
end
return err
end
lib/curl/curl.nit:184,2--203,4