CURL Request

Introduced properties

fun close

curl :: CurlRequest :: close

Close low-level resources associated to this request
fun verbose: Bool

curl :: CurlRequest :: verbose

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

curl :: CurlRequest :: verbose=

Shall this request be verbose?

Redefined properties

redef type SELF: CurlRequest

curl $ CurlRequest :: SELF

Type of this instance, automatically specialized in every class

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
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 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.
init init

core :: Object :: init

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.
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 verbose: Bool

curl :: CurlRequest :: verbose

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

curl :: CurlRequest :: verbose=

Shall this request be verbose?
package_diagram curl::CurlRequest CurlRequest core::Object Object curl::CurlRequest->core::Object curl::CurlHTTPRequest CurlHTTPRequest curl::CurlHTTPRequest->curl::CurlRequest curl::CurlMail CurlMail curl::CurlMail->curl::CurlRequest neo4j::JsonCurlRequest JsonCurlRequest neo4j::JsonCurlRequest->curl::CurlHTTPRequest neo4j::JsonCurlRequest... ... neo4j::JsonCurlRequest...->neo4j::JsonCurlRequest

Parents

interface Object

core :: Object

The root of the class hierarchy.

Children

class CurlHTTPRequest

curl :: CurlHTTPRequest

HTTP request builder
class CurlMail

curl :: CurlMail

CURL Mail Request

Descendants

abstract class JsonCurlRequest

neo4j :: JsonCurlRequest

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

neo4j :: JsonDELETE

HTTP DELETE command
class JsonGET

neo4j :: JsonGET

HTTP GET command
class JsonPOST

neo4j :: JsonPOST

HTTP POST command that sends JSON data
class JsonPUT

neo4j :: JsonPUT

HTTP PUT command that sends JSON data

Class definitions

curl $ CurlRequest
# CURL Request
class CurlRequest

	private var curl = new Curl

	# Shall this request be verbose?
	var verbose: Bool = false is writable

	# Intern perform method, lowest level of request launching
	private fun perform: nullable CurlResponseFailed
	do
		if not self.curl.is_ok then return answer_failure(0, "Curl instance is not correctly initialized")

		var err

		err = self.curl.native.easy_setopt(new CURLOption.verbose, self.verbose)
		if not err.is_ok then return answer_failure(err.to_i, err.to_s)

		err = self.curl.native.easy_perform
		if not err.is_ok then return answer_failure(err.to_i, err.to_s)

		return null
	end

	# Intern method with return a failed answer with given code and message
	private fun answer_failure(error_code: Int, error_msg: String): CurlResponseFailed
	do
		return new CurlResponseFailed(error_code, error_msg)
	end

	# Close low-level resources associated to this request
	#
	# Once closed, this request can't be used again.
	#
	# If this service isn't called explicitly, low-level resources
	# may be freed automatically by the GC.
	fun close do curl.finalize
end
lib/curl/curl.nit:38,1--75,3