1 Forms
Lunny Xiao edited this page 6 years ago

Forms

Get query values from request, there are three forms:

  • By ctx's Forms()
ctx.Forms().Get("get")
ctx.Forms().Int("get") // return int value of key get and an error
ctx.Forms().MustInt("get", 1) // always return int, if error return 1
  • By ctx.Form and etc. methods
ctx.Form("get") // return string
ctx.FormInt("get", 1) // return int and if error return 1
...
...
  • By ctx.Req() and *http.Request
ctx.Req().FormValue("get") // return string