http-types-0.12.4: Generic HTTP types for Haskell (for both client and server code).
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP.Types.Method

Description

Types and constants for HTTP methods.

The HTTP standard defines a set of standard methods, when to use them, and how to handle them. The standard set has been provided as a separate data type StdMethod, but since you can also use custom methods, the basic type Method is just a synonym for ByteString.

Synopsis

HTTP methods

type Method = ByteString Source #

HTTP method (flat ByteString type).

Constants

methodGet :: Method Source #

HTTP GET Method

methodPost :: Method Source #

HTTP POST Method

methodHead :: Method Source #

HTTP HEAD Method

methodPut :: Method Source #

HTTP PUT Method

methodDelete :: Method Source #

HTTP DELETE Method

methodTrace :: Method Source #

HTTP TRACE Method

methodConnect :: Method Source #

HTTP CONNECT Method

methodOptions :: Method Source #

HTTP OPTIONS Method

methodPatch :: Method Source #

HTTP PATCH Method

Since: 0.8.0

Standard Methods

One data type that holds all standard HTTP methods.

data StdMethod Source #

HTTP standard method (as defined by RFC 2616, and PATCH which is defined by RFC 5789).

Since: 0.2.0

Constructors

GET 
POST 
HEAD 
PUT 
DELETE 
TRACE 
CONNECT 
OPTIONS 
PATCH

Since: 0.8.0

Instances

Instances details
Data StdMethod Source #

Since: 0.12.4

Instance details

Defined in Network.HTTP.Types.Method

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StdMethod -> c StdMethod #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StdMethod #

toConstr :: StdMethod -> Constr #

dataTypeOf :: StdMethod -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StdMethod) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StdMethod) #

gmapT :: (forall b. Data b => b -> b) -> StdMethod -> StdMethod #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StdMethod -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StdMethod -> r #

gmapQ :: (forall d. Data d => d -> u) -> StdMethod -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> StdMethod -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod #

Bounded StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Enum StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Generic StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Associated Types

type Rep StdMethod :: Type -> Type #

Ix StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Read StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Show StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Eq StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

Ord StdMethod Source # 
Instance details

Defined in Network.HTTP.Types.Method

type Rep StdMethod Source #

Since: 0.12.4

Instance details

Defined in Network.HTTP.Types.Method

type Rep StdMethod = D1 ('MetaData "StdMethod" "Network.HTTP.Types.Method" "http-types-0.12.4-8sVzaiF2LjrERDtipkARMD" 'False) (((C1 ('MetaCons "GET" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "POST" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HEAD" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PUT" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DELETE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TRACE" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CONNECT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OPTIONS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PATCH" 'PrefixI 'False) (U1 :: Type -> Type)))))

parseMethod :: Method -> Either ByteString StdMethod Source #

Convert a method ByteString to a StdMethod if possible.

Since: 0.2.0

renderMethod :: Either ByteString StdMethod -> Method Source #

Convert an algebraic method to a ByteString.

renderMethod (parseMethod bs) == bs

Since: 0.3.0

renderStdMethod :: StdMethod -> Method Source #

Convert a StdMethod to a ByteString.

Since: 0.2.0