app :: HttpRequestResult :: defaultinit
app :: HttpRequestResult :: maybe_code=
The HTTP status code, if anyapp $ HttpRequestResult :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
app :: HttpRequestResult :: defaultinit
core :: Object :: defaultinit
core :: MaybeError :: 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.
app :: HttpRequestResult :: maybe_code=
The HTTP status code, if anycore :: MaybeError :: maybe_error=
The error, if anycore :: MaybeError :: maybe_value=
The value, if anycore :: Object :: output_class_name
Display class name on stdout (debug only).core :: MaybeError
Helper class used as a return value of methods that may give errors instead of values.
# Result of a call to `Text::http_get`
#
# Users should first check if `is_error` to use `error`.
# Otherwise they can use `value` to get the content of the response
# and `code` for the HTTP status code.
class HttpRequestResult
super MaybeError[String, Error]
# The HTTP status code, if any
var maybe_code: nullable Int
# The status code
#
# Require: `not is_error`
fun code: Int do return maybe_code.as(not null)
end
lib/app/http_request.nit:179,1--194,3