servant-0.2

Safe HaskellNone
LanguageHaskell2010

Servant.API.Delete

Synopsis

Documentation

data Delete Source

Combinator for DELETE requests.

Example:

           -- DELETE /books/:isbn
type MyApi = "books" :> Capture "isbn" Text :> Delete

Instances

HasServer Delete

If you have a Delete endpoint in your API, the handler for this endpoint is meant to delete a resource.

The code of the handler will, just like for Get, Post and Put, run in EitherT (Int, String) IO (). The Int represents the status code and the String a message to be returned. You can use left to painlessly error out if the conditions for a successful deletion are not met.

Typeable * Delete 
type Server Delete = EitherT (Int, String) IO ()