FormValue

Any form values can be retrieved by name, the first value from the given key is returned.

  1. func (c *Ctx) FormValue(key string, defaultValue ...string) string
  1. app.Post("/", func(c *fiber.Ctx) error {
  2. // Get first value from form field "name":
  3. c.FormValue("name")
  4. // => "john" or "" if not exist
  5. // ..
  6. })

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more…