rest
rest copied to clipboard
Add HasHeaderParameter option to set headers
Is your feature request related to a problem?
Currently, the router provides convenient options to set request parameters:
-
HasPathParameter -
HasQueryParameter
However, there is no built-in option for matching request headers, which is often needed for versioning, custom auth, or API feature toggles.
Describe the solution you’d like
Please add a new option, for example:
HasHeaderParameter(name string, p rest.HeaderParam) *Route