network-api-support-0.0.7: Toolkit for building http client libraries over Network.Http.Conduit

Safe HaskellNone




type Responder m a = Request (ResourceT m) -> Response ByteString -> aSource

Response handler.

data JsonResult a Source

Wrap up json parse and decode errors.

parseBody :: FromJSON a => ByteString -> JsonResult aSource

Parse and decode body.

parseBodyWith :: FromJSON a => ByteString -> (Text -> b) -> (Text -> b) -> (a -> b) -> bSource

Parse and decode body handling error cases and success case.

basicResponder :: (Int -> ByteString -> a) -> Responder m aSource

Lift function handling status code and body into a responder.