MCPcopy
hub / github.com/gofiber/fiber / Queries

Method Queries

req.go:979–988  ·  view source on GitHub ↗

Queries returns a map of query parameters and their values. GET /?name=alex&wanna_cake=2&id= Queries()["name"] == "alex" Queries()["wanna_cake"] == "2" Queries()["id"] == "" GET /?field1=value1&field1=value2&field2=value3 Queries()["field1"] == "value2" Queries()["field2"] == "value3" GET /?list_

()

Source from the content-addressed store, hash-verified

977// Queries()["filters[customer][name]"] == "Alice"
978// Queries()["filters[status]"] == "pending"
979func (r *DefaultReq) Queries() map[string]string {
980 app := r.c.app
981 queryArgs := r.c.fasthttp.QueryArgs()
982
983 m := make(map[string]string, queryArgs.Len())
984 for key, value := range queryArgs.All() {
985 m[app.toString(key)] = app.toString(value)
986 }
987 return m
988}
989
990// Query Retrieves the value of a query parameter from the request's URI.
991// The function is generic and can handle query parameter values of different types.

Callers

nothing calls this directly

Calls 3

toStringMethod · 0.80
LenMethod · 0.65
AllMethod · 0.65

Tested by

no test coverage detected