Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- type Method = ByteString
- methodGet :: Method
- methodPost :: Method
- methodHead :: Method
- methodPut :: Method
- methodDelete :: Method
- methodTrace :: Method
- methodConnect :: Method
- methodOptions :: Method
- methodPatch :: Method
- data StdMethod
- parseMethod :: Method -> Either ByteString StdMethod
- renderMethod :: Either ByteString StdMethod -> Method
- renderStdMethod :: StdMethod -> Method
HTTP methods
Constants
methodPost :: Method Source #
HTTP POST Method
methodHead :: Method Source #
HTTP HEAD 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.
HTTP standard method (as defined by RFC 2616, and PATCH which is defined by RFC 5789).
Since: 0.2.0
Instances
Data StdMethod Source # | Since: 0.12.4 | ||||
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 # | |||||
Defined in Network.HTTP.Types.Method | |||||
Enum StdMethod Source # | |||||
Defined in Network.HTTP.Types.Method | |||||
Generic StdMethod Source # | |||||
Defined in Network.HTTP.Types.Method Associated Types
| |||||
Ix StdMethod Source # | |||||
Defined in Network.HTTP.Types.Method Methods range :: (StdMethod, StdMethod) -> [StdMethod] index :: (StdMethod, StdMethod) -> StdMethod -> Int unsafeIndex :: (StdMethod, StdMethod) -> StdMethod -> Int inRange :: (StdMethod, StdMethod) -> StdMethod -> Bool rangeSize :: (StdMethod, StdMethod) -> Int unsafeRangeSize :: (StdMethod, StdMethod) -> Int | |||||
Read StdMethod Source # | |||||
Defined in Network.HTTP.Types.Method | |||||
Show StdMethod Source # | |||||
Eq StdMethod Source # | |||||
Ord StdMethod Source # | |||||
Defined in Network.HTTP.Types.Method | |||||
type Rep StdMethod Source # | Since: 0.12.4 | ||||
Defined in Network.HTTP.Types.Method type Rep StdMethod = D1 ('MetaData "StdMethod" "Network.HTTP.Types.Method" "http-types-0.12.4-CjmG8TUif6e6bpzpwD9FBQ" '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