From 596026f44e91f97c5802ca68ad5f3a1fd2d77023 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 25 Nov 2015 13:29:30 -0500 Subject: [PATCH 1/1] lib/curl: `CurlHTTPRequest::datas` to `data` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/curl/curl.nit | 8 ++++---- lib/curl/examples/curl_http.nit | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/curl/curl.nit b/lib/curl/curl.nit index f225a02..7f754bf 100644 --- a/lib/curl/curl.nit +++ b/lib/curl/curl.nit @@ -79,7 +79,7 @@ class CurlHTTPRequest super NativeCurlCallbacks var url: String - var datas: nullable HeaderMap is writable + var data: nullable HeaderMap is writable var headers: nullable HeaderMap is writable var delegate: nullable CurlCallbacks is writable @@ -125,9 +125,9 @@ class CurlHTTPRequest end # Datas - var datas = self.datas - if datas != null then - var postdatas = datas.to_url_encoded(self.curl) + var data = self.data + if data != null then + var postdatas = data.to_url_encoded(self.curl) err = self.curl.native.easy_setopt(new CURLOption.postfields, postdatas) if not err.is_ok then return answer_failure(err.to_i, err.to_s) end diff --git a/lib/curl/examples/curl_http.nit b/lib/curl/examples/curl_http.nit index d19ee96..9eed5b8 100644 --- a/lib/curl/examples/curl_http.nit +++ b/lib/curl/examples/curl_http.nit @@ -64,11 +64,11 @@ else if args[0] == "POST" then var my_http_fetcher = new MyHttpFetcher request.delegate = my_http_fetcher - var post_datas = new HeaderMap - post_datas["Bugs Bunny"] = "Daffy Duck" - post_datas["Batman"] = "Robin likes special characters @#ùà!è§'(\"é&://,;<>∞~*" - post_datas["Batman"] = "Yes you can set multiple identical keys, but APACHE will consider only one, the last one" - request.datas = post_datas + var post_data = new HeaderMap + post_data["Bugs Bunny"] = "Daffy Duck" + post_data["Batman"] = "Robin likes special characters @#ùà!è§'(\"é&://,;<>∞~*" + post_data["Batman"] = "Yes you can set multiple identical keys, but APACHE will consider only one, the last one" + request.data = post_data var response = request.execute print "Our body from the callback: {my_http_fetcher.fetched_body}" -- 1.7.9.5