Skip to content

Support MIME types #4

@renatoathaydes

Description

@renatoathaydes

Add support according to the specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Check out the JAX-RS way of doing it: https://docs.jboss.org/resteasy/docs/1.0.2.GA/userguide/html/JAX-RS_Content_Negotiation.html

Guava has a MediaType class that helps a little bit with matching accept headers and routes: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/net/MediaType.html

You can copy the MIMEParser from my project if you want (I also copied it, but gave credit to the author - Spark also copied but did not even acknowledge): https://github.com/renatoathaydes/easy-jetty/blob/master/easy-jetty-core/src/main/java/com/athaydes/easyjetty/external/MIMEParse.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions