Param

Attribute that indicates that the parameter is from a path's query. The parameter's type can be any type that can be converted from a string. If the conversion fails a bad request client error is returned to the client and the handler is not called.

struct Param {}

Members

Variables

param
string param;

Indicates the name of the parameter. If not present defaults to the identifier of the function's parameter that the Param attribute is associated to.

Examples

@Get("hello")
_(Response response, @Param string username) {
   response.body_ = "Your username: " ~ username;
}

Meta