commit
648dc2f2fb
3 changed files with 23 additions and 0 deletions
|
@ -31,6 +31,7 @@ library
|
||||||
Servant.API.Delete
|
Servant.API.Delete
|
||||||
Servant.API.Get
|
Servant.API.Get
|
||||||
Servant.API.Header
|
Servant.API.Header
|
||||||
|
Servant.API.Patch
|
||||||
Servant.API.Post
|
Servant.API.Post
|
||||||
Servant.API.Put
|
Servant.API.Put
|
||||||
Servant.API.QueryParam
|
Servant.API.QueryParam
|
||||||
|
|
|
@ -27,6 +27,8 @@ module Servant.API (
|
||||||
module Servant.API.Delete,
|
module Servant.API.Delete,
|
||||||
-- | PUT requests
|
-- | PUT requests
|
||||||
module Servant.API.Put,
|
module Servant.API.Put,
|
||||||
|
-- | PATCH requests
|
||||||
|
module Servant.API.Patch,
|
||||||
|
|
||||||
-- * Untyped endpoints
|
-- * Untyped endpoints
|
||||||
-- | Plugging in a wai 'Network.Wai.Application', serving directories
|
-- | Plugging in a wai 'Network.Wai.Application', serving directories
|
||||||
|
@ -46,6 +48,7 @@ import Servant.API.Get ( Get )
|
||||||
import Servant.API.Header ( Header )
|
import Servant.API.Header ( Header )
|
||||||
import Servant.API.Post ( Post )
|
import Servant.API.Post ( Post )
|
||||||
import Servant.API.Put ( Put )
|
import Servant.API.Put ( Put )
|
||||||
|
import Servant.API.Patch ( Patch )
|
||||||
import Servant.API.QueryParam ( QueryFlag, QueryParams, QueryParam )
|
import Servant.API.QueryParam ( QueryFlag, QueryParams, QueryParam )
|
||||||
import Servant.API.MatrixParam ( MatrixFlag, MatrixParams, MatrixParam )
|
import Servant.API.MatrixParam ( MatrixFlag, MatrixParams, MatrixParam )
|
||||||
import Servant.API.Raw ( Raw )
|
import Servant.API.Raw ( Raw )
|
||||||
|
|
19
src/Servant/API/Patch.hs
Normal file
19
src/Servant/API/Patch.hs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{-# LANGUAGE DeriveDataTypeable #-}
|
||||||
|
module Servant.API.Patch where
|
||||||
|
|
||||||
|
import Data.Typeable ( Typeable )
|
||||||
|
|
||||||
|
-- | Endpoint for PATCH requests. The type variable represents the type of the
|
||||||
|
-- response body (not the request body, use 'Servant.API.ReqBody.ReqBody' for
|
||||||
|
-- that).
|
||||||
|
--
|
||||||
|
-- If the HTTP response is empty, only () is supported.
|
||||||
|
--
|
||||||
|
-- Example:
|
||||||
|
--
|
||||||
|
-- > -- POST /books
|
||||||
|
-- > -- with a JSON encoded Book as the request body
|
||||||
|
-- > -- returning the just-created Book
|
||||||
|
-- > type MyApi = "books" :> ReqBody Book :> Post Book
|
||||||
|
data Patch a
|
||||||
|
deriving Typeable
|
Loading…
Reference in a new issue