urlencoded-0.3.0.0: Generate or process x-www-urlencoded dataSource codeContentsIndex
Data.URLEncoded
Contents
Representation of a URL-encoded string
Generate
Query
Export
Description
Implements a data type for constructing and destructing x-www-urlencoded strings. See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1
Synopsis
data URLEncoded
filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncoded
class URLShow a where
urlShow :: a -> String
class URLEncode a where
urlEncode :: a -> URLEncoded
empty :: URLEncoded
importString :: MonadError e m => String -> m URLEncoded
importList :: [(String, String)] -> URLEncoded
importURI :: MonadError e m => URI -> m URLEncoded
(%=) :: (URLShow a, URLShow b) => a -> b -> URLEncoded
(%=?) :: (URLShow a, URLShow b) => a -> Maybe b -> URLEncoded
(%&) :: (URLEncode q1, URLEncode q2) => q1 -> q2 -> URLEncoded
class AddURLEncoded a where
(%?) :: URLEncode args => a -> args -> a
null :: URLEncoded -> Bool
keys :: URLEncoded -> [String]
lookup :: URLShow a => a -> URLEncoded -> Maybe String
lookupAll :: URLShow a => a -> URLEncoded -> [String]
lookup1 :: (URLShow a, MonadError e m) => a -> URLEncoded -> m String
lookupDefault :: URLShow a => String -> a -> URLEncoded -> String
pairs :: URLEncoded -> [(String, String)]
(%!) :: URLShow a => URLEncoded -> a -> Maybe String
addToURI :: URLEncoded -> URI -> URI
export :: URLEncoded -> String
Representation of a URL-encoded string
data URLEncoded Source
A container for URLEncoded data
show/hide Instances
filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncodedSource
Create a URLEncoded object that represents all pairs from the input that match the supplied predicate
class URLShow a whereSource
Serialize a value into a String for encoding as part of an x-www-urlencoded value
Methods
urlShow :: a -> StringSource
show/hide Instances
class URLEncode a whereSource
Encode a value as x-www-urlencoded
Methods
urlEncode :: a -> URLEncodedSource
show/hide Instances
Generate
empty :: URLEncodedSource
URLEncoded data with no pairs
importString :: MonadError e m => String -> m URLEncodedSource
Parse this string as x-www-urlencoded
importList :: [(String, String)] -> URLEncodedSource
Import this list of pairs as URLEncoded data
importURI :: MonadError e m => URI -> m URLEncodedSource
(%=) :: (URLShow a, URLShow b) => a -> b -> URLEncodedSource
Create singleton URLEncoded data containing the supplied key and value
(%=?)Source
:: (URLShow a, URLShow b)
=> avalue
-> Maybe b
-> URLEncoded
If the second value is Nothing, return empty URLEncoded data. Otherwise return singleton URLEncoded data that contains the given key and value.
(%&) :: (URLEncode q1, URLEncode q2) => q1 -> q2 -> URLEncodedSource
class AddURLEncoded a whereSource
Methods
(%?) :: URLEncode args => a -> args -> aSource
show/hide Instances
Query
null :: URLEncoded -> BoolSource
Is this URLEncoded data empty?
keys :: URLEncoded -> [String]Source
All of the keys from the URLEncoded value, in order, preserving duplicates
lookup :: URLShow a => a -> URLEncoded -> Maybe StringSource
lookupAll :: URLShow a => a -> URLEncoded -> [String]Source
Return all values whose keys match the supplied key, in the order they appear in the query. Will return an empty list if no keys match.
lookup1 :: (URLShow a, MonadError e m) => a -> URLEncoded -> m StringSource
Return the first value for the given key, or throw an error if the key is not present in the URLEncoded data.
lookupDefault :: URLShow a => String -> a -> URLEncoded -> StringSource
pairs :: URLEncoded -> [(String, String)]Source
(%!) :: URLShow a => URLEncoded -> a -> Maybe StringSource
Look up a key in a URLEncoded value and return the first matching value, or Nothing if there is no value that matches
Export
addToURI :: URLEncoded -> URI -> URISource
Add this URL-encoded data to the query part of a URI, after any existing query arguments.
export :: URLEncoded -> StringSource
Convert this URLEncoded object into an x-www-urlencoded String (The resulting string is 7-bit clean ASCII, containing only unreserved URI characters and %-encoded values)
Produced by Haddock version 2.6.0