1{-# LANGUAGE PolyKinds #-}
2{-# LANGUAGE TypeFamilies #-}
3{-# LANGUAGE TypeOperators #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6module Servant.API.RQBody where
8import Control.Applicative
16-- * Request Body support
19instance (FromJSON a, HasServer sublayout)
20 => HasServer (RQBody a :> sublayout) where
22 type Server (RQBody a :> sublayout) =
25 route Proxy subserver request = do
26 mrqbody <- decode' <$> lazyRequestBody request
28 Nothing -> return Nothing
29 Just v -> route (Proxy :: Proxy sublayout) (subserver v) request
31instance (ToJSON a, HasClient sublayout)
32 => HasClient (RQBody a :> sublayout) where
34 type Client (RQBody a :> sublayout) =
37 clientWithRoute Proxy req body =
38 clientWithRoute (Proxy :: Proxy sublayout) $
39 setRQBody (encode body) req
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list