module curl_json
import json::static
+import json
intrude import curl
# An abstract request that defines most of the standard options for Neo4j REST API
class JsonPOST
super JsonCurlRequest
- var data: nullable Jsonable = null is writable
+ var json_data: nullable Jsonable = null is writable
redef fun init_headers do
super
var err = self.curl.native.easy_setopt(new CURLOption.post, true)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
- if self.data != null then
- var postdatas = self.data.to_json
+ if self.json_data != null then
+ var postdatas = self.json_data.to_json
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
class JsonPUT
super JsonCurlRequest
- var data: nullable Jsonable = null is writable
+ var json_data: nullable Jsonable = null is writable
redef fun init_headers do
super
var err = self.curl.native.easy_setopt(new CURLOption.custom_request, "PUT")
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
- if self.data != null then
- var postdatas = self.data.to_json
+ if self.json_data != null then
+ var postdatas = self.json_data.to_json
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