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
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
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}"