servant-0.11: A family of combinators for defining webservices APIs

Safe Haskell | Safe
Language | Haskell2010

Servant.API.Verbs

Contents

- 200 responses
- Other responses
  - 201 Created
  - 202 Accepted
  - 203 Non-Authoritative Information
  - 204 No Content
  - 205 Reset Content
  - 206 Partial Content

Synopsis

- data Verb method statusCode contentTypes a
- type Get = Verb GET 200
- type Post = Verb POST 200
- type Put = Verb PUT 200
- type Delete = Verb DELETE 200
- type Patch = Verb PATCH 200
- type PostCreated = Verb POST 201
- type GetAccepted = Verb GET 202
- type PostAccepted = Verb POST 202
- type DeleteAccepted = Verb DELETE 202
- type PatchAccepted = Verb PATCH 202
- type PutAccepted = Verb PUT 202
- type GetNonAuthoritative = Verb GET 203
- type PostNonAuthoritative = Verb POST 203
- type DeleteNonAuthoritative = Verb DELETE 203
- type PatchNonAuthoritative = Verb PATCH 203
- type PutNonAuthoritative = Verb PUT 203
- type GetNoContent = Verb GET 204
- type PostNoContent = Verb POST 204
- type DeleteNoContent = Verb DELETE 204
- type PatchNoContent = Verb PATCH 204
- type PutNoContent = Verb PUT 204
- type GetResetContent = Verb GET 205
- type PostResetContent = Verb POST 205
- type DeleteResetContent = Verb DELETE 205
- type PatchResetContent = Verb PATCH 205
- type PutResetContent = Verb PUT 205
- type GetPartialContent = Verb GET 206
- class ReflectMethod a where
- data StdMethod :: *
  - = GET
  - | POST
  - | HEAD
  - | PUT
  - | DELETE
  - | TRACE
  - | CONNECT
  - | OPTIONS
  - | PATCH

# Documentation

data Verb method statusCode contentTypes a #

`Verb` is a general type for representing HTTP verbs (a.k.a. methods). For convenience, type synonyms for each verb with a 200 response code are provided, but you are free to define your own:

    >>> type Post204 contentTypes a = Verb 'POST 204 contentTypes a

Instances

HasLink * (Verb k k1 m s ct a) # |
Associated Types type MkLink (Verb k k1 m s ct a) (endpoint :: Verb k k1 m s ct a) :: * # Methods toLink :: Proxy (Verb k k1 m s ct a) endpoint -> Link -> MkLink (Verb k k1 m s ct a) endpoint #
Generic (Verb k k1 method statusCode contentTypes a) # |
Associated Types type Rep (Verb k k1 method statusCode contentTypes a) :: * -> * # Methods from :: Verb k k1 method statusCode contentTypes a -> Rep (Verb k k1 method statusCode contentTypes a) x # to :: Rep (Verb k k1 method statusCode contentTypes a) x -> Verb k k1 method statusCode contentTypes a #
type MkLink * (Verb k k1 m s ct a) # |
type MkLink * (Verb k k1 m s ct a) = Link
type Rep (Verb k k1 method statusCode contentTypes a) # |
type Rep (Verb k k1 method statusCode contentTypes a) = D1 (MetaData "Verb" "Servant.API.Verbs" "servant-0.11-fCWv59w22jEhv7YLGePVV" False) V1

# 200 responses

type Get = Verb GET 200 #

`GET` with 200 status code.

type Post = Verb POST 200 #

`POST` with 200 status code.

type Put = Verb PUT 200 #

`PUT` with 200 status code.

type Delete = Verb DELETE 200 #

`DELETE` with 200 status code.

type Patch = Verb PATCH 200 #

`PATCH` with 200 status code.

# Other responses

## 201 Created

type PostCreated = Verb POST 201 #

`POST` with 201 status code.

## 202 Accepted

type GetAccepted = Verb GET 202 #

`GET` with 202 status code.

type PostAccepted = Verb POST 202 #

`POST` with 202 status code.

type DeleteAccepted = Verb DELETE 202 #

`DELETE` with 202 status code.

type PatchAccepted = Verb PATCH 202 #

`PATCH` with 202 status code.

type PutAccepted = Verb PUT 202 #

`PUT` with 202 status code.

## 203 Non-Authoritative Information

type GetNonAuthoritative = Verb GET 203 #

`GET` with 203 status code.

type PostNonAuthoritative = Verb POST 203 #

`POST` with 203 status code.

type DeleteNonAuthoritative = Verb DELETE 203 #

`DELETE` with 203 status code.

type PatchNonAuthoritative = Verb PATCH 203 #

`PATCH` with 203 status code.

type PutNonAuthoritative = Verb PUT 203 #

`PUT` with 203 status code.

## 204 No Content

type GetNoContent = Verb GET 204 #

`GET` with 204 status code.

type PostNoContent = Verb POST 204 #

`POST` with 204 status code.

type DeleteNoContent = Verb DELETE 204 #

`DELETE` with 204 status code.

type PatchNoContent = Verb PATCH 204 #

`PATCH` with 204 status code.

type PutNoContent = Verb PUT 204 #

`PUT` with 204 status code.

## 205 Reset Content

type GetResetContent = Verb GET 205 #

`GET` with 205 status code.

type PostResetContent = Verb POST 205 #

`POST` with 205 status code.

type DeleteResetContent = Verb DELETE 205 #

`DELETE` with 205 status code.

type PatchResetContent = Verb PATCH 205 #

`PATCH` with 205 status code.

type PutResetContent = Verb PUT 205 #

`PUT` with 205 status code.

## 206 Partial Content

type GetPartialContent = Verb GET 206 #

`GET` with 206 status code.

class ReflectMethod a where #

Minimal complete definition

reflectMethod

Methods

reflectMethod :: Proxy a -> Method #

Instances

ReflectMethod StdMethod PATCH # |
Methods reflectMethod :: Proxy PATCH a -> Method #
ReflectMethod StdMethod OPTIONS # |
Methods reflectMethod :: Proxy OPTIONS a -> Method #
ReflectMethod StdMethod CONNECT # |
Methods reflectMethod :: Proxy CONNECT a -> Method #
ReflectMethod StdMethod TRACE # |
Methods reflectMethod :: Proxy TRACE a -> Method #
ReflectMethod StdMethod DELETE # |
Methods reflectMethod :: Proxy DELETE a -> Method #
ReflectMethod StdMethod PUT # |
Methods reflectMethod :: Proxy PUT a -> Method #
ReflectMethod StdMethod HEAD # |
Methods reflectMethod :: Proxy HEAD a -> Method #
ReflectMethod StdMethod POST # |
Methods reflectMethod :: Proxy POST a -> Method #
ReflectMethod StdMethod GET # |
Methods reflectMethod :: Proxy GET a -> Method #

data StdMethod :: * #

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

Constructors

GET |
POST |
HEAD |
PUT |
DELETE |
TRACE |
CONNECT |
OPTIONS |
PATCH |

Instances

Bounded StdMethod |
Methods minBound :: StdMethod # maxBound :: StdMethod #
Enum StdMethod |
Methods succ :: StdMethod -> StdMethod # pred :: StdMethod -> StdMethod # toEnum :: Int -> StdMethod # fromEnum :: StdMethod -> Int # enumFrom :: StdMethod -> [StdMethod] # enumFromThen :: StdMethod -> StdMethod -> [StdMethod] # enumFromTo :: StdMethod -> StdMethod -> [StdMethod] # enumFromThenTo :: StdMethod -> StdMethod -> StdMethod -> [StdMethod] #
Eq StdMethod |
Methods (==) :: StdMethod -> StdMethod -> Bool # (/=) :: StdMethod -> StdMethod -> Bool #
Ord StdMethod |
Methods compare :: StdMethod -> StdMethod -> Ordering # (<) :: StdMethod -> StdMethod -> Bool # (<=) :: StdMethod -> StdMethod -> Bool # (>) :: StdMethod -> StdMethod -> Bool # (>=) :: StdMethod -> StdMethod -> Bool # max :: StdMethod -> StdMethod -> StdMethod # min :: StdMethod -> StdMethod -> StdMethod #
Read StdMethod |
Methods readsPrec :: Int -> ReadS StdMethod # readList :: ReadS [StdMethod] # readPrec :: ReadPrec StdMethod # readListPrec :: ReadPrec [StdMethod] #
Show StdMethod |
Methods showsPrec :: Int -> StdMethod -> ShowS # show :: StdMethod -> String # showList :: [StdMethod] -> ShowS #
Ix StdMethod |
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
ReflectMethod StdMethod PATCH # |
Methods reflectMethod :: Proxy PATCH a -> Method #
ReflectMethod StdMethod OPTIONS # |
Methods reflectMethod :: Proxy OPTIONS a -> Method #
ReflectMethod StdMethod CONNECT # |
Methods reflectMethod :: Proxy CONNECT a -> Method #
ReflectMethod StdMethod TRACE # |
Methods reflectMethod :: Proxy TRACE a -> Method #
ReflectMethod StdMethod DELETE # |
Methods reflectMethod :: Proxy DELETE a -> Method #
ReflectMethod StdMethod PUT # |
Methods reflectMethod :: Proxy PUT a -> Method #
ReflectMethod StdMethod HEAD # |
Methods reflectMethod :: Proxy HEAD a -> Method #
ReflectMethod StdMethod POST # |
Methods reflectMethod :: Proxy POST a -> Method #
ReflectMethod StdMethod GET # |
Methods reflectMethod :: Proxy GET a -> Method #