Fork me on GitHub
#ring
<
2021-06-16
>
Endre Bakken Stovner13:06:31

If I want to communicate with my web-server by sending JSON from the command line using curl POST requests, how would I get the correct CSRF-token?

Endre Bakken Stovner13:06:57

I have this home-routes definition:

(defn home-routes []
  [""
   {:middleware [middleware/wrap-csrf
                 middleware/wrap-formats]}
   ["/" {:get home-page}]
   ["/json" {:post #(constantly "json")}]
I can only know the CSRF token from webpages served to me, right? Then how could I automatically get it from my server?