minion-0.1.0.0: A Haskell introspectable web router
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Minion.Request.Body

Synopsis

Documentation

newtype ReqBody (cts :: [Type]) a Source #

Constructors

ReqBody a 

Instances

Instances details
IsRequest (ReqBody cts a) Source # 
Instance details

Defined in Web.Minion.Request.Body

Associated Types

type RequestValue (ReqBody cts a) Source #

Methods

getRequestValue :: ReqBody cts a -> RequestValue (ReqBody cts a) Source #

type RequestValue (ReqBody cts a) Source # 
Instance details

Defined in Web.Minion.Request.Body

type RequestValue (ReqBody cts a) = a

class DecodeBody cts a where Source #

Methods

decodeBody Source #

Arguments

:: (MonadIO m, MonadThrow m) 
=> MakeError 
-> ByteString

Content-Type header value

-> IO ByteString

Request body

-> m (ReqBody cts a) 

Instances

Instances details
DecodeBody ('[] :: [Type]) a Source # 
Instance details

Defined in Web.Minion.Request.Body

Methods

decodeBody :: (MonadIO m, MonadThrow m) => MakeError -> ByteString -> IO ByteString -> m (ReqBody '[] a) Source #

(ContentType ct, Decode ct a, DecodeBody cts a) => DecodeBody (ct ': cts) a Source # 
Instance details

Defined in Web.Minion.Request.Body

Methods

decodeBody :: (MonadIO m, MonadThrow m) => MakeError -> ByteString -> IO ByteString -> m (ReqBody (ct ': cts) a) Source #

class Decode ct a where Source #

Instances

Instances details
FromForm a => Decode FormUrlEncoded a Source # 
Instance details

Defined in Web.Minion.Request.Body

FromJSON a => Decode Json a Source # 
Instance details

Defined in Web.Minion.Media.Json

Decode PlainText Text Source # 
Instance details

Defined in Web.Minion.Request.Body

Decode PlainText Text Source # 
Instance details

Defined in Web.Minion.Request.Body

Decode PlainText String Source # 
Instance details

Defined in Web.Minion.Request.Body

reqBody Source #

Arguments

:: forall cts r m i ts. Introspection i Request (ReqBody cts r) 
=> (MonadIO m, MonadThrow m) 
=> DecodeBody cts r 
=> ValueCombinator i (WithReq m (ReqBody cts r)) ts m

.

Extracts request body with specified Content-Type

... /> reqBody @'[PlainText] @MyRequest