Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
type Method = ByteString Source #
HTTP method (flat ByteString
type).
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
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