diff --git a/router.go b/router.go index 3d88783..313d86d 100644 --- a/router.go +++ b/router.go @@ -3,6 +3,7 @@ package nirajan import ( "fmt" "net/http" + "net/url" "reflect" "runtime" "strings" @@ -335,3 +336,8 @@ func (r *SimpleRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { } r.MethodNotAllowedResp(w, req) } + +func QueryParams(req *http.Request) map[string][]string { + u, _ := url.Parse(req.URL.String()) + return u.Query() +}