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.
func (c *Ctx) Query(key string, defaultValue ...string) string
// GET http://example.com/shoes?order=desc&brand=nike
app.Get("/", func(c *fiber.Ctx) error {
c.Query("order") // "desc"
c.Query("brand") // "nike"
c.Query("empty", "nike") // "nike"
// ...
})
Returned value is only valid within the handler. Do not store any references.
Make copies or use theImmutable
setting instead. Read more…