Context

Lunny Xiao edited this page Aug 28, 2015 · 2 revisions

Context

Context has many convenient method for complete your work.

Req()

Get *Request object.

Forms()

Get query value by query key. See Forms

Cookies()

Get Cookies object.

SecureCookies()

Get secure Cookies.

ServeFile()

Send file to web browser.

ServeJson()

Send Json to web browser.

ServeXml()

Send Xml to web browser.

Download()

Download some file.

SaveToFile()

Save uploaded file to disk file.

Params()

Get router's matched params.

Action()

If executor is a struct, then return the pointer of struct, or return nil.

Redirect()

Write redirect to web browser.

NotModified()

Return 304.

Unauthorized()

Return unauthorized.

NotFound()

Return 404

Abort()

Return customized error.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.