hweblib-0.4: Haskell Web Library

Network.Types

Contents

Synopsis

HTTP Types

data Method Source

HTTP Methods

Instances

data HttpVersion Source

HTTP Version holds major and minor numbers.

Constructors

HttpVersion 

Fields

httpMajor :: Int
 
httpMinor :: Int
 

data Header Source

HTTP Headers

data RequestUri Source

Constructors

Asterisk

like in OPTIONS * HTTP/1.1

AbsoluteUri URI

commonly used in proxy servers

AbsolutePath ByteString

like /asd.cgi

RelativeRef URI

with a query part like /asd.cgi?foo=bar

Authority (Maybe URIAuth)

Just the authority part

data Request Source

Constructors

Request 

Fields

rqMethod :: Method

Request Method

rqUri :: RequestUri

Request URI

rqVersion :: HttpVersion

HTTP Version as a tuple

rqHeaders :: [(ByteString, ByteString)]

Request Headers as an alist

rqBody :: ByteString

Request Body

Instances

data Response Source

Constructors

Response 

Fields

rpCode :: Int

Response Code

rpHeaders :: [(ByteString, ByteString)]

Response Headers as an alist

rpVersion :: (Int, Int)

HTTP Version

rpMessage :: ByteString

Response Message

Instances

data URI Source

Constructors

URI 

Fields

uriScheme :: String

Ex: http or https

uriAuthority :: Maybe URIAuth
 
uriPath :: String

Path is the part between the authority and the query

uriQuery :: String

Query begins with ?

uriFragment :: String

Fragment begins with '#'

Instances

data URIAuth Source

Constructors

URIAuth 

Fields

uriUserInfo :: String

username:password

uriRegName :: String

registered name, ex: www.core.gen.tr

uriPort :: String

Port as a string

Instances

Misc Types