I don't seem to be able to capture request body any more.
Everything started here when I hit the problem after an update.
I was trying to investigate it and got to a point where I cant get the request body niether with scotty's body
function nor with Network.WAI functions on which Scotty builds.
I could probably parse the json body myself only if I could get it.
I am trying this and it does not work. I just get an empty bytestring.
import qualified Data.ByteString.Char8 as C
import Control.Monad.Trans (liftIO)
import Web.Scotty.Trans
import Network.Wai (requestBody)
loginUser :: ActionD ()
loginUser = do
r <- request
b <- liftIO $ requestBody r
if C.null b then error "Empty" else error ("Body: " ++ (C.unpack b))
So what am I doing wrong to catch the request body? What changes have been made to Scotty recently so that it stop working as usual?
Thanks