YAML mime type?

What is the most suitable MIME type for sending data structured using YAML over HTTP?

It would be very helpful to explain why this choice is most suitable.

There is no registered application type or text type that I see.

Example:

> GET /example.yaml < Content-Type: ???? < < --- # Favorite movies < - Casablanca < - North by Northwest < - Notorious 

Possible options:

 text/yaml text/x-yaml application/yaml application/x-yaml 
+91
mime-types yaml mime
Dec 01 '08 at 20:41
source share
5 answers

Ruby on Rails uses application/x-yaml with an alternative to text/yaml ( source ).

I think this is just a matter of agreement, there are no technical reasons as far as I can tell.

+55
Dec 01 '08 at 20:50
source share
β€” -

Although a different answer has been accepted, please refer to this Proposed Media Type Registration for the YAML branch on the IANA mailing list to view the Media Type in which Ben Harris, University of Cambridge Information Services, proposed in July 2015 on behalf of the YAML team media type .:

 text/vnd.yaml 

with (suggested) deprecated aliases:

 text/yaml text/x-yaml application/x-yaml 

This is still being proposed / expected (the stream does not indicate the status of the proposal), so this answer is no more final than the others :-)

+16
Jun 23 '16 at 20:13
source share

I would say text / x-yaml:

text on top of the application because it is human readable

x-yaml over yaml because it was not accepted into the registered list of mime types.

Edit: from RFC 3023 (XML Media Types):

The β€œtext” format at the top level is some restrictions on MIME objects and they are described in [RFC2045] and [RFC2046]. In particular, the UTF-16, UCS-4, and UTF-32 families are not allowed (except for HTTP [RFC2616], which uses a MIME-like mechanism).

Interesting ... Not quite sure what that means, but food for thought.

+14
Dec 01 '08 at 20:50
source share

"x-" media types are not welcome, see RFC 4288, Section 3.4 . The right decision is to use a personal tree, a supplier tree, or actually try to register the media type correctly.

+6
Jun 24 '10 at 15:04
source share

I know this is ugly, but use text / plain if you want to display it in a browser and format it correctly. All of the above will by default load in IE or Firefox.

-9
Jun 24 '10 at 14:24
source share



All Articles