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

Safe HaskellNone
LanguageHaskell98

Network.Api.Support.Response

Synopsis

Documentation

type Responder a = Request -> Response ByteString -> a Source

Response handler.

data JsonResult a Source

Wrap up json parse and decode errors.

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

Parse and decode body.

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

Parse and decode body handling error cases and success case.

basicResponder :: (Int -> ByteString -> a) -> Responder a Source

Lift function handling status code and body into a responder.