yesod-core-0.10.1: Creation of type-safe, RESTful web applications.

Safe HaskellSafe-Infered




Provides a parsed version of the raw Request data.


Request datatype

type RequestBodyContents = ([(Text, Text)], [(Text, FileInfo)])Source

A tuple containing both the POST parameters and submitted files.

data Request Source

The parsed request information.




reqGetParams :: [(Text, Text)]
reqCookies :: [(Text, Text)]
reqWaiRequest :: Request
reqLangs :: [Text]

Languages which the client supports.

reqNonce :: Maybe Text

A random, session-specific nonce used to prevent CSRF attacks.

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.

This is handled by parseWaiRequest (not exposed).

Lookup parameters

lookupGetParam :: Text -> GHandler s m (Maybe Text)Source

Lookup for GET parameters.

lookupCookie :: Text -> GHandler s m (Maybe Text)Source

Lookup for cookie data.

lookupFile :: Text -> GHandler s m (Maybe FileInfo)Source

Lookup for POSTed files.


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.