Skip to content
Mathias edited this page Mar 8, 2012 · 4 revisions

spray defines the most important media types from the IANA MIME media type registry. in the MediaTypes object, which also acts as a registry that you register your own CustomMediaType instances with.

Once registered incoming requests with your custom media type will properly be resolved to your type and file extension resolution (see the File and Resource Directives) will work as expected.

For an example of how a custom media type can be used you might want to take a look at the "markdown-server" example (see the Example Projects chapter), which uses the custom media type text/x-markdown for content that needs to be converted to text/html by a custom directive.

Clone this wiki locally