forked from spray/spray
-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Media Types
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.
- Home
- Requirements
- spray-server
- ... Getting Started
- ... Key Concepts
- ...... Request Lifecycle
- ...... Routes
- ...... Directives
- ...... Composing Directives
- ...... Rejections
- ...... Marshalling and Unmarshalling
- ... Predefined Directives
- ...... Method Filters
- ...... Path Filters
- ...... Parameter Filters
- ...... Form-Field Filters
- ...... Marshalling/Unmarshalling
- ...... Caching
- ...... Detach
- ...... Encoding/Decoding
- ...... Authentication/Authorization
- ...... File and Resource Directives
- ...... Misc Directives
- ... Advanced Topics
- ...... Case Class Extraction
- ...... Custom Directives
- ...... Custom Media Types
- ...... Custom Error Responses
- ... Configuration
- ... Testing
- ... Example Projects
- spray-client
- Patch Policy
- Credits
- Sponsors