http-monad-0.1.1.3: Monad abstraction for HTTP allowing lazy transfer and non-I/O simulation

Copyright(c) 2009 Henning Thielemann
LicenseBSD
Stabilityexperimental
Portabilitynon-portable (not tested)
Safe HaskellSafe
LanguageHaskell98

Network.Monad.HTTP.Header

Description

Provide the functionality of Network.HTTP.Headers with qualified identifier style.

Synopsis

Documentation

class HasHeaders x where #

HasHeaders is a type class for types containing HTTP headers, allowing you to write overloaded header manipulation functions for both Request and Response data types, for instance.

Minimal complete definition

getHeaders, setHeaders

Methods

getHeaders :: x -> [Header] #

setHeaders :: x -> [Header] -> x #

Instances
HasHeaders (Request a) 
Instance details

Defined in Network.HTTP.Base

Methods

getHeaders :: Request a -> [Header] #

setHeaders :: Request a -> [Header] -> Request a #

HasHeaders (Response a) 
Instance details

Defined in Network.HTTP.Base

Methods

getHeaders :: Response a -> [Header] #

setHeaders :: Response a -> [Header] -> Response a #

type T = Header Source #

data Header #

The Header data type pairs header names & values.

Constructors

Header HeaderName String 
Instances
Show Header 
Instance details

Defined in Network.HTTP.Headers

data HeaderName #

HTTP HeaderName type, a Haskell data constructor for each specification-defined header, prefixed with Hdr and CamelCased, (i.e., eliding the - in the process.) Should you require using a custom header, there's the HdrCustom constructor which takes a String argument.

Encoding HTTP header names differently, as Strings perhaps, is an equally fine choice..no decidedly clear winner, but let's stick with data constructors here.

Instances
Eq HeaderName 
Instance details

Defined in Network.HTTP.Headers

Show HeaderName 
Instance details

Defined in Network.HTTP.Headers

setMany :: HasHeaders x => x -> [T] -> x Source #

getMany :: HasHeaders x => x -> [T] Source #

modifyMany :: HasHeaders x => ([T] -> [T]) -> x -> x Source #

insert :: HasHeaders a => Name -> String -> a -> a Source #

Inserts a header with the given name and value. Allows duplicate header names.

insertMany :: HasHeaders a => [T] -> a -> a Source #

Inserts multiple headers.

insertIfMissing :: HasHeaders a => Name -> String -> a -> a Source #

Adds the new header only if no previous header shares the same name.

retrieveMany :: HasHeaders a => Name -> a -> [T] Source #

Gets a list of headers with a particular Name.

replace :: HasHeaders a => Name -> String -> a -> a Source #

Removes old headers with duplicate name.

find :: HasHeaders a => Name -> a -> Maybe String Source #

Lookup presence of specific Name in a list of Headers Returns the value from the first matching header.

lookup :: Name -> [T] -> Maybe String Source #

Deprecated: Call find using the [Header] instance of HasHeaders