Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (14 sloc) 564 Bytes
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Handler.Warp
import Network.Wai.Parse
import Data.ByteString.UTF8 (toString)
import Data.ByteString.Lazy.UTF8 (fromString)
main = run 3000 $ \req -> do
body <- parseRequestBody lbsSink req
return $ responseLBS status200 [("Content-Type", "plain")] $ fromString $ unlines
[ "Path info: " ++ toString (pathInfo req)
, "Query string: " ++ toString (queryString req)
, "Request body: " ++ show body
, "Method: " ++ toString (requestMethod req)
]
Jump to Line
Something went wrong with that request. Please try again.