Skip to content
Mathias edited this page Jul 26, 2011 · 4 revisions

spray defines the most important media types from 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 More Examples 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