Params

Method can be used to get the route parameters, you could pass an optional default value that will be returned if the param key does not exist.

Defaults to empty string (""), if the param doesn’t exist.
  1. c.Params(param string, defaultValue ...string) string
  1. // GET http://example.com/user/fenny
  2. app.Get("/user/:name", func(c *fiber.Ctx) {
  3. c.Params("name") // "fenny"
  4. c.Params("age", "21") // "21"
  5. })

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