Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Parsing and rendering of MIME types
Synopsis
- class MIMEType mt => BodyUnrender m mt a where
- bodyUnrender :: mt -> Request -> m (Either Text a)
- class MIMEType mt => BodyRender m mt a where
- bodyRender :: mt -> Response -> a -> m (MediaType, ResponseBody)
- inMemoryBackend :: BackEnd ByteString
- tempFileBackend :: MonadResource m => m (BackEnd FilePath)
Parsing and rendering MIME types
class MIMEType mt => BodyUnrender m mt a where Source #
Instances of this class are used to parse the body of a request as specified by a MIME type.
bodyUnrender :: mt -> Request -> m (Either Text a) Source #
Parse a request body. Return a Left
value with error messages
in case of failure.
Instances
class MIMEType mt => BodyRender m mt a where Source #
Instances of this class serializes a value to a response body as specified by a MIME type.
bodyRender :: mt -> Response -> a -> m (MediaType, ResponseBody) Source #
Render a value in the format specified by the media type.
Returns the response body and the media type to be used in the "Content-Type" header. This could be a variant of the original media type with additional parameters.
Instances
FormData utils
inMemoryBackend :: BackEnd ByteString Source #
A backend that stores all files in memory
tempFileBackend :: MonadResource m => m (BackEnd FilePath) Source #
A backend that stores files in a temp directory.