If deserialize_json
, the default behavior, this method is invoked only if deserialization was successful.
In this case, result
may be any deserialized object.
Otherwise, if not deserialize_json
, result
contains the content of the response as a String
.
# Invoked when the HTTP request returned valid data
#
# If `deserialize_json`, the default behavior, this method is invoked only if deserialization was successful.
# In this case, `result` may be any deserialized object.
#
# Otherwise, if `not deserialize_json`, `result` contains the content of the response as a `String`.
fun on_load(result: nullable Object, http_status_code: Int) do end
lib/app/http_request.nit:127,2--133,67
redef fun on_load(data, status) do if status < 200 or status >= 299
then print_error "HTTP request '{uri}' received HTTP status code: {status}"
lib/app/http_request.nit:160,2--161,76