diff --git a/lib/curl/curl.nit b/lib/curl/curl.nit index 18f05c865c..293d252d0e 100644 --- a/lib/curl/curl.nit +++ b/lib/curl/curl.nit @@ -211,10 +211,10 @@ class CurlHTTPRequest if data != null then var postdatas = data.to_url_encoded(self.curl) - err = self.curl.native.easy_setopt(new CURLOption.postfields, postdatas) + err = self.curl.native.easy_setopt(new CURLOption.copypostfields, postdatas) if not err.is_ok then return err else if body != null then - err = self.curl.native.easy_setopt(new CURLOption.postfields, body) + err = self.curl.native.easy_setopt(new CURLOption.copypostfields, body) if not err.is_ok then return err end return new CURLCode.ok diff --git a/lib/curl/native_curl.nit b/lib/curl/native_curl.nit index d3ed43a1c2..c331a1d1f4 100644 --- a/lib/curl/native_curl.nit +++ b/lib/curl/native_curl.nit @@ -584,12 +584,14 @@ extern class CURLOption `{ CURLoption `} # Issue a HTTP POS request. new post `{ return CURLOPT_POST; `} - # Send a POST with this data. + # Send a POST with this data, which must remain valid until the transfer completes. new postfields `{ return CURLOPT_POSTFIELDS; `} + # Send a POST with a copy of this data. + new copypostfields `{ return CURLOPT_COPYPOSTFIELDS; `} + # new `{ return CURLOPT_POSTFIELDSIZE; `} # new `{ return CURLOPT_POSTFIELDSIZE_LARGE; `} -# new `{ return CURLOPT_COPYPOSTFIELDS; `} # new `{ return CURLOPT_HTTPPOST; `} # new `{ return CURLOPT_REFERER; `} diff --git a/lib/neo4j/curl_json.nit b/lib/neo4j/curl_json.nit index d6c4275382..7b4cd37677 100644 --- a/lib/neo4j/curl_json.nit +++ b/lib/neo4j/curl_json.nit @@ -120,7 +120,7 @@ class JsonPOST if self.json_data != null then var postdatas = self.json_data.to_json - err = self.curl.native.easy_setopt(new CURLOption.postfields, postdatas) + err = self.curl.native.easy_setopt(new CURLOption.copypostfields, postdatas) if not err.is_ok then return answer_failure(err.to_i, err.to_s) end return null @@ -155,7 +155,7 @@ class JsonPUT if self.json_data != null then var postdatas = self.json_data.to_json - err = self.curl.native.easy_setopt(new CURLOption.postfields, postdatas) + err = self.curl.native.easy_setopt(new CURLOption.copypostfields, postdatas) if not err.is_ok then return answer_failure(err.to_i, err.to_s) end return null