curl :: MyHttpFetcher :: defaultinit
curl :: MyHttpFetcher :: fetched_body=
Body of the downloaded filecurl $ MyHttpFetcher :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
curl :: CurlCallbacks :: defaultinit
core :: Object :: defaultinit
curl :: MyHttpFetcher :: defaultinit
curl :: MyHttpFetcher :: fetched_body=
Body of the downloaded filecore :: 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 :: output_class_name
Display class name on stdout (debug only).
# Custom delegate to receive callbacks from a Curl transfer
class MyHttpFetcher
super CurlCallbacks
# Body of the downloaded file
var fetched_body = ""
redef fun header_callback(line) do
# We keep this callback silent for testing purposes
#if not line.has_prefix("Date:") then print "Header_callback: {line}"
end
redef fun body_callback(line) do self.fetched_body += line
redef fun stream_callback(buffer) do print "Stream_callback: {buffer}"
end
lib/curl/examples/curl_http.nit:22,1--37,3