respond-1.1.0: process and route HTTP requests and generate responses on top of WAI

Safe HaskellNone
LanguageHaskell2010

Web.Respond.Types.Request

Contents

Description

defines the FromBody typeclass and instances for

  • lazy Text
  • lazy extracted json
  • strict extracted json

Synopsis

Documentation

class ReportableError e => FromBody e a | a -> e where Source

something that can be pulled from the body, restricted to a ReportableError type.

Methods

fromBody :: ByteString -> Either e a Source

parse the body. note that the body is provided as a lazy ByteString. how that ByteString is loaded depends on the caller of fromBody.

some instances

text

JSON

newtype Json a Source

newtype for things that should be encoded as or parsed as Json.

the FromBody instance uses eitherDecode - the lazy version.

Constructors

Json 

Fields

getJson :: a
 

newtype JsonS a Source

newtype for things that should be encoded as or parsed as Json.

the FromBody instance uses the immediate eitherDecode' parser.

Constructors

JsonS 

Fields

getJsonS :: a