respond
This commit is contained in:
parent
8ab09931c4
commit
f3b459e9ce
@ -53,7 +53,9 @@ module Yesod.Core.Handler
|
||||
, lookupPostParams
|
||||
, lookupCookies
|
||||
, lookupFiles
|
||||
-- * Special responses
|
||||
-- * Responses
|
||||
-- ** Pure
|
||||
, respond
|
||||
-- ** Streaming
|
||||
, respondSource
|
||||
, sendChunk
|
||||
@ -915,6 +917,14 @@ rawRequestBody = do
|
||||
fileSource :: MonadResource m => FileInfo -> Source m S.ByteString
|
||||
fileSource = transPipe liftResourceT . fileSourceRaw
|
||||
|
||||
-- | Provide a pure value for the response body.
|
||||
--
|
||||
-- > respond ct = return . TypedContent ct . toContent
|
||||
--
|
||||
-- Since 1.2.0
|
||||
respond :: (Monad m, ToContent a) => ContentType -> a -> m TypedContent
|
||||
respond ct = return . TypedContent ct . toContent
|
||||
|
||||
-- | Use a @Source@ for the response body.
|
||||
--
|
||||
-- Note that, for ease of use, the underlying monad is a @HandlerT@. This
|
||||
|
||||
Loading…
Reference in New Issue
Block a user