Fork me on GitHub
#reitit
<
2020-09-24
>
benny22:09:25

how do i get the current “request method” from middleware?

(defn foo-mw [handler]
  (fn [req]
    (prn (-> req (ring/get-match) :data))
    (handler req)))
the output is at the route level, not the request method level 😕

benny23:09:59

found it thanks to the swagger middleware

(fn [{::r/keys [match] :keys [request-method] :as req}]
    (prn (-> match :result request-method :data :foo))

👍 3