-
Notifications
You must be signed in to change notification settings - Fork 28
Request
Brian Zou edited this page Mar 6, 2019
·
2 revisions
Returning an Http request object,
In the action, you can directly call the following method to get some information about the request.
request.method; //return GET or POST
request.path; //return /path/to/request
request.GET; //return all get params
request.POST; //return all post params
request.FILES; //return all files params
request.get!int("uid"); ///fetch uid as int from get params
request.post!int("uid"); ///fetch uid as int from post params
request.session().get('key'); ///return session value
request.cookie().get('name'); // return a cookie value
request.clientIp; ///
For more usage, please refer to the [source/hunt/http/request.d] file under the hunt framework.