Property definitions

neo4j $ JsonPOST :: defaultinit
# HTTP POST command that sends JSON data
class JsonPOST
	super JsonCurlRequest

	var json_data: nullable Serializable = null is writable

	redef fun init_headers do
		super
		headers["Content-Type"] = "application/json"
	end

	redef fun execute_hook do
		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.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
		return null
	end
end
lib/neo4j/curl_json.nit:106,1--128,3