Copyright | (c) Colin Woodbury 2018 |
---|---|
License | BSD3 |
Maintainer | Colin Woodbury <colingw@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Servant support for XML.
Types with a ToXml
instance will be automatically marshalled into XML
and successfully returned by Servant endpoints.
Types with a FromXml
instance can be decoded from request bodies.
In implementing these typeclass instances, you can use the primitives found in the xmlbf library.
Synopsis
- data XML
Documentation
The application/xml Content-Type. To be used in Servant endpoints like:
data Foo = ... instance ToXml Foo where toXml foo = ... type API = ... :<|> "foo" :> Get '[XML] Foo :<|> "foo" :> "update" :> ReqBody '[XML] Foo :> PostAccepted '[JSON] ()
Instances
Accept XML Source # | |
Defined in Servant.XML | |
ToXml a => MimeRender XML a Source # | |
Defined in Servant.XML mimeRender :: Proxy XML -> a -> ByteString # | |
FromXml a => MimeUnrender XML a Source # | |
Defined in Servant.XML mimeUnrender :: Proxy XML -> ByteString -> Either String a # mimeUnrenderWithType :: Proxy XML -> MediaType -> ByteString -> Either String a # |