Safe Haskell | Safe-Infered |
---|
Some helpers for parsing data out of a raw WAI Request
.
- parseHttpAccept :: ByteString -> [ByteString]
- parseRequestBody :: BackEnd y -> Request -> ResourceT IO ([Param], [File y])
- data RequestBodyType
- getRequestBodyType :: Request -> Maybe RequestBodyType
- sinkRequestBody :: BackEnd y -> RequestBodyType -> Sink ByteString (ResourceT IO) ([Param], [File y])
- conduitRequestBody :: BackEnd y -> RequestBodyType -> Conduit ByteString (ResourceT IO) (Either Param (File y))
- type BackEnd a = ByteString -> FileInfo () -> Sink ByteString (ResourceT IO) a
- lbsBackEnd :: Monad m => ignored1 -> ignored2 -> Sink ByteString m ByteString
- tempFileBackEnd :: MonadResource m => ignored1 -> ignored2 -> Sink ByteString m FilePath
- tempFileBackEndOpts :: MonadResource m => IO FilePath -> String -> ignored1 -> ignored2 -> Sink ByteString m FilePath
- type Param = (ByteString, ByteString)
- type File y = (ByteString, FileInfo y)
- data FileInfo c = FileInfo {}
Documentation
parseHttpAccept :: ByteString -> [ByteString]Source
Parse the HTTP accept string to determine supported content types.
sinkRequestBody :: BackEnd y -> RequestBodyType -> Sink ByteString (ResourceT IO) ([Param], [File y])Source
conduitRequestBody :: BackEnd y -> RequestBodyType -> Conduit ByteString (ResourceT IO) (Either Param (File y))Source
= ByteString | parameter name |
-> FileInfo () | |
-> Sink ByteString (ResourceT IO) a |
A file uploading backend. Takes the parameter name, file name, and content
type, and returns a Sink
for storing the contents.
lbsBackEnd :: Monad m => ignored1 -> ignored2 -> Sink ByteString m ByteStringSource
Store uploaded files in memory
tempFileBackEnd :: MonadResource m => ignored1 -> ignored2 -> Sink ByteString m FilePathSource
Save uploaded files on disk as temporary files
:: MonadResource m | |
=> IO FilePath | get temporary directory |
-> String | filename pattern |
-> ignored1 | |
-> ignored2 | |
-> Sink ByteString m FilePath |
Same as tempFileSink
, but use configurable temp folders and patterns.
type Param = (ByteString, ByteString)Source
type File y = (ByteString, FileInfo y)Source
Information on an uploaded file.
FileInfo | |
|