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.

Property definitions

app $ AsyncHttpRequest :: on_load
	# 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

app $ SimpleAsyncHttpRequest :: on_load
	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

app $ MyHttpRequest :: on_load
	redef fun on_load(data, status)
	do win.label_response.text = "Received response code {status} with {data.as(Text).byte_length} bytes"
lib/app/examples/http_request_example.nit:51,2--52,102