curl :: CurlRequest
curl :: CurlRequest :: _curl
curl :: CurlRequest :: answer_failure
Intern method with return a failed answer with given code and messagecurl :: CurlRequest :: curl
curl :: CurlRequest :: curl=
curl :: CurlRequest :: defaultinit
curl :: CurlRequest :: perform
Intern perform method, lowest level of request launchingcurl $ CurlRequest :: SELF
Type of this instance, automatically specialized in every classcurl :: CurlRequest :: _curl
curl :: CurlRequest :: answer_failure
Intern method with return a failed answer with given code and messagecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
curl :: CurlRequest :: curl
curl :: CurlRequest :: curl=
curl :: CurlRequest :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).curl :: CurlRequest :: perform
Intern perform method, lowest level of request launching
# 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