-
Notifications
You must be signed in to change notification settings - Fork 0
Request
The request object is a property of the Controller base class and the object can be accessed by any class that extends Controller with:
this.req
The request object expose all information about the request from the user. The Request class extends the nodejs http.ServerListener
Query strings are parsed and stored in the property queryStrings
// for the path /Dashboard/doSomething?name=Hugo&age=18
console.log(this.req.queryStrings);
// Would output
{
name:"Hugo",
age:"18"
}
Params are parsed by the pattern: /name/value/ meaning that if you would like to pass the id and name for a user you would use the following path /Dashboard/doSomething/name/Hugo/id/4.
// for the path /Dashboard/doSomething/name/Hugo/id/4
console.log(this.req.params);
// Would output
{
name:"Hugo",
age:"18"
}
A read only property returning the cookies sent to the user
A readonly property returning the request type the user used to access the server. It returns en enum of ActionType.
PyramidJS only supports JSON request but if you want to parse any other type of data use a middleware.