Safe Haskell | None |
---|---|
Language | Haskell2010 |
Web.Respond.Types.Request
Contents
Description
defines the FromBody
typeclass and instances for
- lazy Text
- lazy extracted json
- strict extracted json
- class ReportableError e => FromBody e a | a -> e where
- fromBody :: ByteString -> Either e a
- newtype TextBody = TextBody {
- getTextBody :: Text
- newtype TextBodyS = TextBodyS {
- getTextBodyS :: Text
- newtype Json a = Json {
- getJson :: a
- newtype JsonS a = JsonS {
- getJsonS :: a
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.
Instances
some instances
text
Constructors
TextBody | |
Fields
|
Constructors
TextBodyS | |
Fields
|
JSON
newtype for things that should be encoded as or parsed as Json.
the FromBody instance uses eitherDecode
- the lazy version.
Instances
FromJSON a => FromBody JsonParseError (Json a) | |
ToJSON a => ToResponseBody (Json a) |
newtype for things that should be encoded as or parsed as Json.
the FromBody
instance uses the immediate eitherDecode'
parser.
Instances
FromJSON a => FromBody JsonParseError (JsonS a) | |
ToJSON a => ToResponseBody (JsonS a) |