Query

This property is an object containing a property for each query string parameter in the route, you could pass an optional default value that will be returned if the query key does not exist.

If there is no query string, it returns an empty string.
  1. func (c *Ctx) Query(key string, defaultValue ...string) string
  1. // GET http://example.com/shoes?order=desc&brand=nike
  2. app.Get("/", func(c *fiber.Ctx) error {
  3. c.Query("order") // "desc"
  4. c.Query("brand") // "nike"
  5. c.Query("empty", "nike") // "nike"
  6. // ...
  7. })

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