nitcorn :: ParamAction :: defaultinit
nitcorn $ ParamAction :: SELF
Type of this instance, automatically specialized in every classnitcorn $ ParamAction :: answer
Prepare aHttpResponse
destined to the client in response to the request
HttpResponse
destined to the client in response to the request
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitcorn :: Action :: defaultinit
nitcorn :: ParamAction :: defaultinit
core :: Object :: 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.
core :: Object :: output_class_name
Display class name on stdout (debug only).nitcorn :: Action :: prepare_respond_and_close
Full to arequest
with sending the response and closing of the http_server
# An action that uses parameterized uris to customize the output.
class ParamAction
super Action
redef fun answer(http_request, turi)
do
var response = new HttpResponse(200)
var name = http_request.param("name")
if name == null then
response.body = "No name..."
else
response.body = "Hello {name}"
end
return response
end
end
lib/nitcorn/examples/src/nitcorn_hello_world.nit:53,1--68,3