http-types-0.1: Generic HTTP types for Haskell (for both client and server code).

Network.HTTP.Types

Contents

Synopsis

Case insensitive HTTP ByteStrings

data HttpCIByteString Source

Case-insensitive HTTP ByteStrings, mostly for use in Header names.

Methods

type Method = ByteStringSource

HTTP method (flat string type).

methodPost :: MethodSource

HTTP Method constants.

data MethodADT Source

HTTP method (ADT version).

Note that the Show instance is only for debugging and should NOT be used to generate HTTP method strings; use methodToByteString instead.

The constructor OtherMethod is not exported for forwards compatibility reasons.

Constructors

GET 
POST 
HEAD 
PUT 
DELETE 
TRACE 
CONNECT 
OPTIONS 

methodToADT :: Method -> MethodADTSource

Convert a method ByteString to a MethodADT.

methodFromADT :: MethodADT -> MethodSource

Convert a MethodADT to a ByteString.

Versions

data HttpVersion Source

HTTP Version.

Note that the Show instance is intended merely for debugging.

Status

data Status Source

HTTP Status.

Only the statusCode is used for comparisons.

Note that the Show instance is only for debugging.

Instances

statusNotAllowed :: StatusSource

Method Not Allowed

statusServerError :: StatusSource

Internal Server Error

Headers

Query string

type Query = [(ByteString, Maybe ByteString)]Source

Query.

General form: a=b&c=d, but if the value is Nothing, it becomes a&c=d.

type QuerySimple = [(ByteString, ByteString)]Source

Simplified Query type without support for parameter-less items.