GetQuery is like Query(), it returns the keyed url query value if it exists `(value, true)` (even when the value is an empty string), otherwise it returns `("", false)`. It is shortcut for `c.Request.URL.Query().Get(key)` GET /?name=Manu&lastname= ("Manu", true) == c.GetQuery("name") ("", false)
(key string)
| 552 | // ("", false) == c.GetQuery("id") |
| 553 | // ("", true) == c.GetQuery("lastname") |
| 554 | func (c *Context) GetQuery(key string) (string, bool) { |
| 555 | if values, ok := c.GetQueryArray(key); ok { |
| 556 | return values[0], ok |
| 557 | } |
| 558 | return "", false |
| 559 | } |
| 560 | |
| 561 | // QueryArray returns a slice of strings for a given query key. |
| 562 | // The length of the slice depends on the number of params with the given key. |