URLParams returns a map of URL Query parameters. If the value of a URL parameter is a slice, then it is joined as one separated by comma. It returns an empty map on empty URL query. See URLParamsSorted too.
()
| 1708 | // |
| 1709 | // See URLParamsSorted too. |
| 1710 | func (ctx *Context) URLParams() map[string]string { |
| 1711 | q := ctx.getQuery() |
| 1712 | values := make(map[string]string, len(q)) |
| 1713 | |
| 1714 | for k, v := range q { |
| 1715 | values[k] = strings.Join(v, ",") |
| 1716 | } |
| 1717 | |
| 1718 | return values |
| 1719 | } |
| 1720 | |
| 1721 | // URLParamsSorted returns a sorted (by key) slice |
| 1722 | // of key-value entries of the URL Query parameters. |