Skip to content

Request

Brian Zou edited this page Mar 6, 2019 · 2 revisions

Request Request

  • Introduction

Returning an Http request object,

  • Basic use

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.

Clone this wiki locally