urlencoded-0.5.0.0: Generate or process x-www-urlencoded data
Safe HaskellNone
LanguageHaskell2010

Data.URLEncoded

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

Representation of a URL-encoded string

data URLEncoded Source #

A container for URLEncoded data

Instances

Instances details
Eq URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

Show URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

Semigroup URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

Monoid URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

URLShow URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

URLEncode URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

AddURLEncoded URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

Methods

(%?) :: URLEncode args => URLEncoded -> args -> URLEncoded Source #

filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncoded Source #

Create a URLEncoded object that represents all pairs from the input that match the supplied predicate

class URLShow a where Source #

Serialize a value into a String for encoding as part of an x-www-urlencoded value

Methods

urlShow :: a -> String Source #

Instances

Instances details
URLShow Bool Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlShow :: Bool -> String Source #

URLShow Char Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlShow :: Char -> String Source #

URLShow Int Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlShow :: Int -> String Source #

URLShow Integer Source # 
Instance details

Defined in Data.URLEncoded

URLShow URI Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlShow :: URI -> String Source #

URLShow URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

URLShow [Char] Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlShow :: [Char] -> String Source #

class URLEncode a where Source #

Encode a value as x-www-urlencoded

Methods

urlEncode :: a -> URLEncoded Source #

Instances

Instances details
URLEncode URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

URLEncode a => URLEncode (Maybe a) Source # 
Instance details

Defined in Data.URLEncoded

(URLShow a, URLShow b) => URLEncode (a, b) Source # 
Instance details

Defined in Data.URLEncoded

Methods

urlEncode :: (a, b) -> URLEncoded Source #

Generate

empty :: URLEncoded Source #

URLEncoded data with no pairs

importString :: MonadFail m => String -> m URLEncoded Source #

Parse this string as x-www-urlencoded @since 0.5.0.0

importList :: [(String, String)] -> URLEncoded Source #

Import this list of pairs as URLEncoded data

importURI :: MonadFail m => URI -> m URLEncoded Source #

Since: 0.5.0.0

(%=) :: (URLShow a, URLShow b) => a -> b -> URLEncoded infixl 8 Source #

Create singleton URLEncoded data containing the supplied key and value

(%=?) infixl 8 Source #

Arguments

:: (URLShow a, URLShow b) 
=> a

key

-> Maybe b

value

-> 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 -> URLEncoded infixr 7 Source #

class AddURLEncoded a where Source #

Methods

(%?) :: URLEncode args => a -> args -> a infixr 6 Source #

Instances

Instances details
AddURLEncoded URI Source # 
Instance details

Defined in Data.URLEncoded

Methods

(%?) :: URLEncode args => URI -> args -> URI Source #

AddURLEncoded URLEncoded Source # 
Instance details

Defined in Data.URLEncoded

Methods

(%?) :: URLEncode args => URLEncoded -> args -> URLEncoded Source #

AddURLEncoded [Char] Source # 
Instance details

Defined in Data.URLEncoded

Methods

(%?) :: URLEncode args => [Char] -> args -> [Char] Source #

Query

null :: URLEncoded -> Bool Source #

Is this URLEncoded data empty?

keys :: URLEncoded -> [String] Source #

All of the keys from the URLEncoded value, in order, preserving duplicates

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, MonadFail m) => a -> URLEncoded -> m String Source #

Return the first value for the given key, or throw an error if the key is not present in the URLEncoded data. @since 0.5.0.0

(%!) :: URLShow a => URLEncoded -> a -> Maybe String infixr 1 Source #

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 -> URI Source #

Add this URL-encoded data to the query part of a URI, after any existing query arguments.

export :: URLEncoded -> String Source #

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)