linnet-0.4.0.1: Lightweight library for building HTTP API

Safe HaskellNone
LanguageHaskell2010

Linnet.Endpoints.Headers

Synopsis

Documentation

header :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m a Source #

Endpoint that tries to decode header name from a request. Always matches, but may throw an exception in case:

  • Headers is not presented in the request
  • There was a header decoding error

headerMaybe :: forall a m. (DecodeEntity a, MonadThrow m) => ByteString -> Endpoint m (Maybe a) Source #

Endpoint that tries to decode header name from a request. Always matches, but may throw an exception in case:

  • There was a header decoding error