              (transient {})
              (.keySet params)))))
 
+(defn get-query-params
+  "Parse query params from context and return a
+  maybe multivalue map."
+  [^DefaultContext context]
+  (get-query-params* (:catacumba/request context)))
+
+(defn get-route-params*
+  "Return a hash-map with parameters extracted from
+  routing patterns."
+  [^Context ctx]
+  (into {} utils/keywordice-keys-t (.getPathTokens ctx)))
+
 (defn get-route-params
   "Return a hash-map with parameters extracted from
   routing patterns."
   [^DefaultContext context]
-  (let [^Context ctx (:catacumba/context context)]
-    (into {} utils/keywordice-keys-t (.getPathTokens ctx))))
-
-(defn get-headers
-  [^DefaultContext context]
-  (let [^Request request (:catacumba/request context)
-        ^Headers headers (.getHeaders request)
-          ^MultiValueMap headers (.asMultiValueMap headers)]
+  (get-route-params* (:catacumba/context context)))
+
+(defn get-headers*
+  [^Request request]
+  (let [^Headers headers (.getHeaders request)
+        ^MultiValueMap headers (.asMultiValueMap headers)]
     (persistent!
      (reduce (fn [acc ^String key]
                (let [values (.getAll headers key)

     (.next ctx)))
  ([^DefaultContext context data]
   (let [^Context ctx (:catacumba/context context)
         previous (get-context-params context)
         ^Registry reg (Registry/single (ContextData. (merge previous data)))]
     (.next ctx reg))))

(defn public-address
  "Get the current public address as URI instance.

   :secure (.isSecure cookie)
   :max-age (.maxAge cookie)})

(defn get-cookies*
  "Get the incoming cookies."
  {:internal true :no-doc true}
  [^Request request]
  (persistent!
   (reduce (fn [acc cookie]
             (let [name (keyword (.name cookie))]
               (assoc! acc name (cookie->map cookie))))
           (transient {})
           (into [] (.getCookies request)))))

(defn get-cookies
  "Get the incoming cookies."
  [^DefaultContext context]
  (get-cookies* (:catacumba/request context)))

(defn set-status!
  "Set the response http status."
