mohws-0.2.1: Modular Haskell Web Server





setGroup :: HasHeaders x => x -> Group -> xSource

list :: HasHeaders x => x -> [T]Source

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

data Header

The Header data type pairs header names & values.


Header HeaderName String 


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 decidedly clear winner, but let's stick with data constructors here.

class HasHeaders x

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.

Header parsing

Header manipulation

insert :: HasHeaders a => Name -> String -> a -> aSource

replace :: HasHeaders a => Name -> String -> a -> aSource

insertMany :: HasHeaders a => [T] -> a -> aSource

Constructing headers

Getting values of specific headers