QueryParamOr returns the query param or default value for the provided name. Note: QueryParamOr does not distinguish if query had no value by that name or value was empty string This means URLs `/test?search=` and `/test` would both return `1` for `c.QueryParamOr("search", "1")`
(name, defaultValue string)
| 373 | // Note: QueryParamOr does not distinguish if query had no value by that name or value was empty string |
| 374 | // This means URLs `/test?search=` and `/test` would both return `1` for `c.QueryParamOr("search", "1")` |
| 375 | func (c *Context) QueryParamOr(name, defaultValue string) string { |
| 376 | value := c.QueryParam(name) |
| 377 | if value == "" { |
| 378 | value = defaultValue |
| 379 | } |
| 380 | return value |
| 381 | } |
| 382 | |
| 383 | // QueryParams returns the query parameters as `url.Values`. |
| 384 | func (c *Context) QueryParams() url.Values { |