Getting the unmodified post body with Noir
Just a quick little post today about something that was more frustrating than you’d expect to google. Basically all I wanted was to get the entire post body without any modifications to it in any way, shape or form by any form of middle ware.
Sounds simple, and really it was very simple, once I found a random Google Groups post talking about it.
First thing is first, add this line to your view
(:require [noir.request :as request])
Then access the body within your defpage with the following code:
(let [request (request/ring-request)
body (slurp(:body request))]
And there you go. The quick, easy, no noise to fight through explanation of how to get the entire post body in WebNoir.