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

Safe HaskellNone




type Responder a = Request -> 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 aSource

Lift function handling status code and body into a responder.