happstack-server-7.9.3: Web related tools and services.

Safe Haskell | None
Language | Haskell2010

Happstack.Server.Internal.MessageWrap

Synopsis

- split :: (a -> Bool) -> [a] -> ([a], [a])
- queryInput :: SURI -> [(String, Input)]
- decodeBody :: BodyPolicy -> Maybe ContentType -> ByteString -> IO ([(String, Input)], Maybe String)
- data BodyPolicy = BodyPolicy {
  - inputWorker :: Int64 -> Int64 -> Int64 -> InputWorker
  - maxDisk :: Int64
  - maxRAM :: Int64
  - maxHeader :: Int64
  }
- defaultBodyPolicy :: FilePath -> Int64 -> Int64 -> Int64 -> BodyPolicy
- bodyInput :: MonadIO m => BodyPolicy -> Request -> m ([(String, Input)], Maybe String)
- formDecode :: String -> [(String, Input)]
- formDecodeBS :: ByteString -> [(String, Input)]
- multipartDecode :: InputWorker -> [(String, String)] -> ByteString -> IO ([(String, Input)], Maybe String)
- pathEls :: String -> [String]
- splitList :: Eq a => a -> [a] -> [[a]]
- splitListBy :: (a -> Bool) -> [a] -> [[a]]
- defaultInputIter :: FileSaver -> FilePath -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Work -> IO InputIter

# Documentation

split :: (a -> Bool) -> [a] -> ([a], [a]) Source #

Split is like break, but the matching element is dropped.

queryInput :: SURI -> [(String, Input)] Source #

decodeBody :: BodyPolicy -> Maybe ContentType -> ByteString -> IO ([(String, Input)], Maybe String) Source #

data BodyPolicy Source #

see `defaultBodyPolicy`

Constructors

BodyPolicy |

Fields

- inputWorker :: Int64 -> Int64 -> Int64 -> InputWorker
- maxDisk :: Int64

  maximum bytes for files uploaded in this `Request`

- maxRAM :: Int64

  maximum bytes for all non-file values in the `Request` body

- maxHeader :: Int64

  maximum bytes of overhead for headers in `multipart/form-data`

defaultBodyPolicy Source #

Arguments

:: FilePath | temporary directory for file uploads
-> Int64 | maximum bytes for files uploaded in this `Request`
-> Int64 | maximum bytes for all non-file values in the `Request` body
-> Int64 | maximum bytes of overhead for headers in `multipart/form-data`
-> BodyPolicy |

create a `BodyPolicy` for use with decodeBody

bodyInput :: MonadIO m => BodyPolicy -> Request -> m ([(String, Input)], Maybe String) Source #

formDecode :: String -> [(String, Input)] Source #

Decodes application/x-www-form-urlencoded inputs. TODO: should any of the [] be error conditions?

formDecodeBS :: ByteString -> [(String, Input)] Source #

Decodes application/x-www-form-urlencoded inputs. TODO: should any of the [] be error conditions?

multipartDecode Source #

Arguments

:: InputWorker |
-> [(String, String)] | Content-type parameters
-> ByteString | Request body
-> IO ([(String, Input)], Maybe String) | Input variables and values.

Decodes multipart/form-data input.

pathEls :: String -> [String] Source #

Get the path components from a String.

splitList :: Eq a => a -> [a] -> [[a]] Source #

Repeadly splits a list by the provided separator and collects the results

splitListBy :: (a -> Bool) -> [a] -> [[a]] Source #

Repeatedly splits a list and collects the results

defaultInputIter :: FileSaver -> FilePath -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Work -> IO InputIter Source #