I'm trying to create some middleware that will send 500 errors to a remote server. The error information is in the response body.
How can I get the response body from a Response
as any kind of string? I see responseToStream
but I can't figure out how to use it.
import Network.Wai
import Data.ByteString.Lazy (ByteString)
responseBody :: Response -> IO ByteString
responseBody res = _
An implementation of the comment by @user2407038: