The request currently is only able to represent an HTTP request.
- data Request = ReqHttp {}
- data FieldList
- data Version
- data Method
- fromList :: [(String, String)] -> FieldList
- singleton :: (String, String) -> FieldList
- empty :: FieldList
- toList :: FieldList -> [(String, String)]
- parseQString :: String -> FieldList
- find :: (String -> Bool) -> FieldList -> [String]
- findWithDefault :: (String, String) -> FieldList -> String
- ifindWithDefault :: (String, String) -> FieldList -> String
- change :: (String, String) -> FieldList -> FieldList
- insert :: (String, String) -> FieldList -> FieldList
- replace :: (String, String) -> FieldList -> FieldList
- replaces :: [(String, String)] -> FieldList -> FieldList
- union :: FieldList -> FieldList -> FieldList
- unionAll :: FieldList -> FieldList -> FieldList
- showURL :: Request -> String
- showQString :: Request -> String
- showProtocol :: Request -> String
- showAuthority :: Request -> String
- showPath :: Request -> String
- parseURL :: String -> Maybe Request
Types
ReqHttp | |
|
Key-value list.
All known HTTP methods
FieldList related functions
parseQString :: String -> FieldListSource
Parse a query string.
findWithDefault :: (String, String) -> FieldList -> StringSource
Finds a the value defined in a fieldlist or returns a default value. In the event there are multiple values under the same key the first one is returned.
ifindWithDefault :: (String, String) -> FieldList -> StringSource
Same as findWithDefault but the match is case-insenstiive.
change :: (String, String) -> FieldList -> FieldListSource
Updates all occurrences of a given key with a new value. Does nothing if the values does not exist.
replace :: (String, String) -> FieldList -> FieldListSource
Inserts or updates occurrences of a given key.
replaces :: [(String, String)] -> FieldList -> FieldListSource
Same as replace but work on a list type
union :: FieldList -> FieldList -> FieldListSource
Combines two fieldsets, but prefere items of the first list.
Request related functions
showQString :: Request -> StringSource
Show the querty string of the URL.
showProtocol :: Request -> StringSource
Show the protocol in use (currently either https or http)
showAuthority :: Request -> StringSource
Show the host+port path of the request. May return only the host when (ssl=False && port==80) or (ssl=True && port==443).