Safe Haskell | None |
---|
Provides a parsed version of the raw Request
data.
- type RequestBodyContents = ([(Text, Text)], [(Text, FileInfo)])
- data Request = Request {
- reqGetParams :: [(Text, Text)]
- reqCookies :: [(Text, Text)]
- reqWaiRequest :: Request
- reqLangs :: [Text]
- reqToken :: Maybe Text
- reqBodySize :: Word64
- data FileInfo
- fileName :: FileInfo -> Text
- fileContentType :: FileInfo -> Text
- fileSource :: FileInfo -> Source (ResourceT IO) ByteString
- fileMove :: FileInfo -> FilePath -> IO ()
- languages :: GHandler s m [Text]
- lookupGetParam :: Text -> GHandler s m (Maybe Text)
- lookupPostParam :: Text -> GHandler s m (Maybe Text)
- lookupCookie :: Text -> GHandler s m (Maybe Text)
- lookupFile :: Text -> GHandler s m (Maybe FileInfo)
- lookupGetParams :: Text -> GHandler s m [Text]
- lookupPostParams :: Text -> GHandler s m [Text]
- lookupCookies :: Text -> GHandler s m [Text]
- lookupFiles :: Text -> GHandler s m [FileInfo]
Request datatype
type RequestBodyContents = ([(Text, Text)], [(Text, FileInfo)])Source
A tuple containing both the POST parameters and submitted files.
The parsed request information.
Request | |
|
fileSource :: FileInfo -> Source (ResourceT IO) ByteStringSource
Convenience functions
languages :: GHandler s m [Text]Source
Get the list of supported languages supplied by the user.
Languages are determined based on the following three (in descending order of preference):
- The _LANG get parameter.
- The _LANG cookie.
- The _LANG user session variable.
- Accept-Language HTTP header.
Yesod will seek the first language from the returned list matched with languages supporting by your application. This language will be used to render i18n templates. If a matching language is not found the default language will be used.
This is handled by parseWaiRequest (not exposed).
Lookup parameters
Multi-lookup
lookupGetParams :: Text -> GHandler s m [Text]Source
Lookup for GET parameters.
lookupPostParams :: Text -> GHandler s m [Text]Source
Lookup for POST parameters.
lookupCookies :: Text -> GHandler s m [Text]Source
Lookup for cookie data.
lookupFiles :: Text -> GHandler s m [FileInfo]Source
Lookup for POSTed files.