hoauth-0.1.2: A Haskell implementation of OAuth 1.0a protocol.Source codeContentsIndex
data Request = HTTP {
ssl :: Bool
method :: HTTPMethod
host :: String
port :: Int
path :: String
params :: [Parameter]
data HTTPMethod
type Parameter = (String, Maybe String)
class PercentEncoding a where
encode :: a -> ByteString
encodes :: [a] -> ByteString
decode :: ByteString -> (a, ByteString)
decodes :: ByteString -> [a]
append_param :: Request -> (String, Maybe String) -> Request
show_url :: Request -> ByteString
show_oauthurl :: Request -> ByteString
show_oauthheader :: String -> Request -> ByteString
show_urlencoded :: [Parameter] -> ByteString
read_urlencoded :: ByteString -> [Parameter]
(>>+) :: Request -> (String, Maybe String) -> Request
data Request Source
The HTTP request which must be properly authenticated with oauth. It is not meant to represent the full HTTP request, instead the data which matters for oauth authentication.
ssl :: BoolTrue means HTTPS and false means HTTP
method :: HTTPMethod
host :: StringThe hostname or ip address (e.g. bitforest.org)
port :: IntThe tcp port (e.g. 80)
path :: StringThe request path (e.g. /foo/bar/)
params :: [Parameter]The request parameters (both GET and POST)
show/hide Instances
data HTTPMethod Source
The possible HTTP methods
show/hide Instances
type Parameter = (String, Maybe String)Source
A pair which represents a parameter (key,value).
class PercentEncoding a whereSource
Refer to http://en.wikipedia.org/wiki/Percent-encoding for more information
encode :: a -> ByteStringSource
Encodes an a type to bytestring.
encodes :: [a] -> ByteStringSource
Encodes a list of a types into bytestring.
decode :: ByteString -> (a, ByteString)Source
Decodes a single a type out of an encoded string.
decodes :: ByteString -> [a]Source
Decodes the whole string into a list of a types.
show/hide Instances
append_param :: Request -> (String, Maybe String) -> RequestSource
Convenience function to append an item in request's parameters list
show_url :: Request -> ByteStringSource
Show the entire url, including possibly any oauth parameter which may be present.
show_oauthurl :: Request -> ByteStringSource
The URL to perform the oauth request
:: StringThe realm
-> Request
-> ByteStringThe Authorization/WWW-Authenticate header
The Authorization or WWW-Authenticated headers to perform oauth authentication.
show_urlencoded :: [Parameter] -> ByteStringSource
Produces a urlencoded string. For convenience, it sorts the parameters first, as demands the oauth protocol.
read_urlencoded :: ByteString -> [Parameter]Source
Parses a urlencoded string.
(>>+) :: Request -> (String, Maybe String) -> RequestSource
Convenience operator to append an item in request's parameters list
Produced by Haddock version 2.6.0