put package:snap-core

Builds an HTTP "PUT" request. Example:
ghci> :set -XOverloadedStrings
ghci> buildRequest $ put "/foo/bar" "text/plain" "some text"
PUT /foo/bar HTTP/1.1
content-type: text/plain
content-length: 9
host: localhost

sn="localhost" c=127.0.0.1:60000 s=127.0.0.1:8080 ctx=/ clen=9
Puts a new Request object into the Snap monad. Example:
ghci> :set -XOverloadedStrings
ghci> import qualified Data.Map as M
ghci> import qualified Snap.Test as T
ghci> :{
ghci| let hndlr = do rq <- T.buildRequest (T.get "/bar/foo" M.empty)
ghci|                putRequest rq
ghci|                uri' <- getsRequest rqURI
ghci|                writeBS uri'
ghci| :}
ghci> T.runHandler (T.get "/foo/bar" M.empty) hndlr
HTTP/1.1 200 OK
server: Snap/test
date: Wed, 06 Aug 2014 15:13:46 GMT

/bar/foo
Puts a new Response object into the Snap monad. Example:
ghci> :set -XOverloadedStrings
ghci> import qualified Data.Map as M
ghci> import qualified Snap.Test as T
ghci> let rsp = setResponseCode 404 emptyResponse
ghci> let req = T.get "/foo/bar" M.empty
ghci> T.runHandler req (putResponse rsp)
HTTP/1.1 404 Not Found
server: Snap/test
date: Wed, 06 Aug 2014 13:59:58 GMT
Run the given stream procedure, adding its output to the Response stored in the Snap monad state. Example:
ghci> :set -XOverloadedStrings
ghci> import qualified Data.Map as M
ghci> import qualified Snap.Test as T
ghci> import qualified Data.ByteString.Builder as B
ghci> import qualified System.IO.Streams as Streams
ghci> let r = T.get "/foo/bar" M.empty
ghci> :{
ghci| let f str = do {
ghci|   Streams.write (Just $ B.byteString "Hello, streams world") str;
ghci|   return str }
ghci| :}
ghci> T.runHandler r (addToOutput f)
HTTP/1.1 200 OK
server: Snap/test
date: Wed, 06 Aug 2014 17:55:47 GMT

Hello, streams world
Does this upload policy stipulate that we want to treat parts without filenames as form input?
Get the maximum size of a form input which will be read into our rqParams map.
Get the maximum size of a form input which will be read into our rqParams map.
Set the maximum size of a form input which will be read into our rqParams map.
Set the maximum size of a form input which will be read into our rqParams map.
Set the upload policy for treating parts without filenames as form input.