HTTP POST command that sends JSON data

Introduced properties

init defaultinit(url: String, data: nullable HeaderMap, body: nullable String, headers: nullable HeaderMap, delegate: nullable CurlCallbacks, user_agent: nullable String, unix_socket_path: nullable String, method: nullable String, auth: nullable String)

neo4j :: JsonPOST :: defaultinit

fun json_data=(json_data: nullable Serializable)

neo4j :: JsonPOST :: json_data=

Redefined properties

redef type SELF: JsonPOST

neo4j $ JsonPOST :: SELF

Type of this instance, automatically specialized in every class
redef fun execute_hook: nullable CurlResponse

neo4j $ JsonPOST :: execute_hook

Hook to implement in concrete requests
redef fun init_headers

neo4j $ JsonPOST :: init_headers

init HTTP headers for Neo4j REST API

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun auth: nullable String

neo4j :: JsonCurlRequest :: auth

OAuth token
fun auth=(auth: nullable String)

neo4j :: JsonCurlRequest :: auth=

OAuth token
fun body: nullable String

curl :: CurlHTTPRequest :: body

Raw body string
fun body=(body: nullable String)

curl :: CurlHTTPRequest :: body=

Raw body string
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun close

curl :: CurlRequest :: close

Close low-level resources associated to this request
fun data: nullable HeaderMap

curl :: CurlHTTPRequest :: data

Data for the body of a POST request
fun data=(data: nullable HeaderMap)

curl :: CurlHTTPRequest :: data=

Data for the body of a POST request
init defaultinit(url: String, data: nullable HeaderMap, body: nullable String, headers: nullable HeaderMap, delegate: nullable CurlCallbacks, user_agent: nullable String, unix_socket_path: nullable String, method: nullable String)

curl :: CurlHTTPRequest :: defaultinit

init defaultinit(url: String, data: nullable HeaderMap, body: nullable String, headers: nullable HeaderMap, delegate: nullable CurlCallbacks, user_agent: nullable String, unix_socket_path: nullable String, method: nullable String, auth: nullable String)

neo4j :: JsonCurlRequest :: defaultinit

init defaultinit(url: String, data: nullable HeaderMap, body: nullable String, headers: nullable HeaderMap, delegate: nullable CurlCallbacks, user_agent: nullable String, unix_socket_path: nullable String, method: nullable String, auth: nullable String)

neo4j :: JsonPOST :: defaultinit

fun delegate: nullable CurlCallbacks

curl :: CurlHTTPRequest :: delegate

Delegates to customize the behavior when running execute
fun delegate=(delegate: nullable CurlCallbacks)

curl :: CurlHTTPRequest :: delegate=

Delegates to customize the behavior when running execute
fun download_to_file(output_file_name: nullable String): CurlResponse

curl :: CurlHTTPRequest :: download_to_file

Download to file given resource
fun execute: CurlResponse

curl :: CurlHTTPRequest :: execute

Execute HTTP request
protected fun execute_hook: nullable CurlResponse

neo4j :: JsonCurlRequest :: execute_hook

Hook to implement in concrete requests
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun headers: nullable HeaderMap

curl :: CurlHTTPRequest :: headers

Header content of the request
fun headers=(headers: nullable HeaderMap)

curl :: CurlHTTPRequest :: headers=

Header content of the request
init init

core :: Object :: init

protected fun init_headers

neo4j :: JsonCurlRequest :: init_headers

init HTTP headers for Neo4j REST API
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun json_data=(json_data: nullable Serializable)

neo4j :: JsonPOST :: json_data=

fun method: String

curl :: CurlHTTPRequest :: method

The HTTP method, GET by default
fun method=(method: nullable String)

curl :: CurlHTTPRequest :: method=

The HTTP method, GET by default
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun unix_socket_path: nullable String

curl :: CurlHTTPRequest :: unix_socket_path

Set the Unix domain socket path to use
fun unix_socket_path=(unix_socket_path: nullable String)

curl :: CurlHTTPRequest :: unix_socket_path=

Set the Unix domain socket path to use
fun url: String

curl :: CurlHTTPRequest :: url

Address of the remote resource to request
protected fun url=(url: String)

curl :: CurlHTTPRequest :: url=

Address of the remote resource to request
fun user_agent: nullable String

curl :: CurlHTTPRequest :: user_agent

Set the user agent for all following HTTP requests
fun user_agent=(user_agent: nullable String)

curl :: CurlHTTPRequest :: user_agent=

Set the user agent for all following HTTP requests
fun verbose: Bool

curl :: CurlRequest :: verbose

Shall this request be verbose?
fun verbose=(verbose: Bool)

curl :: CurlRequest :: verbose=

Shall this request be verbose?
package_diagram neo4j::JsonPOST JsonPOST neo4j::JsonCurlRequest JsonCurlRequest neo4j::JsonPOST->neo4j::JsonCurlRequest curl::CurlHTTPRequest CurlHTTPRequest neo4j::JsonCurlRequest->curl::CurlHTTPRequest ...curl::CurlHTTPRequest ... ...curl::CurlHTTPRequest->curl::CurlHTTPRequest

Ancestors

class CurlHTTPRequest

curl :: CurlHTTPRequest

HTTP request builder
class CurlRequest

curl :: CurlRequest

CURL Request
interface NativeCurlCallbacks

curl :: NativeCurlCallbacks

Interface for internal information callbacks methods
interface Object

core :: Object

The root of the class hierarchy.

Parents

abstract class JsonCurlRequest

neo4j :: JsonCurlRequest

An abstract request that defines most of the standard options for Neo4j REST API

Class definitions

neo4j $ JsonPOST
# 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