neo4j :: JsonPUT :: defaultinit
# HTTP PUT command that sends JSON data
class JsonPUT
	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.custom_request, "PUT")
		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:141,1--163,3