Property definitions

app $ SimpleAsyncHttpRequest :: defaultinit
# Simple `AsyncHttpRequest` where `uri` is an attribute
#
# Prints on communication errors and when the remote server returns an
# HTTP status code not in the 200s.
#
# This class can be instantiated to execute a request where the response is
# ignored by the application. Alternatively, it can be subclassed to implement
# `on_load`.
#
# ~~~nitish
# var request = new SimpleAsyncHttpRequest("http://example.com")
# request.start
# ~~~
class SimpleAsyncHttpRequest
	super AsyncHttpRequest

	redef var uri

	redef fun on_load(data, status) do if status < 200 or status >= 299
	then print_error "HTTP request '{uri}' received HTTP status code: {status}"
end
lib/app/http_request.nit:142,1--162,3