YAML media type?

前端 未结 6 1958
旧巷少年郎
旧巷少年郎 2020-12-04 11:10

What is the most appropriate media type (formally MIME type) to use when sending data structured with YAML over HTTP and why?

There is no registered application type

6条回答
  •  长情又很酷
    2020-12-04 11:40

    I'd say text/x-yaml:

    text over application because it's a human-readable

    x-yaml over yaml because it hasn't been accepted into the registered list of mime types.

    Edit: from RFC 3023 (XML Media Types):

    The top-level media type "text" has some restrictions on MIME entities and they are described in [RFC2045] and [RFC2046]. In particular, the UTF-16 family, UCS-4, and UTF-32 are not allowed (except over HTTP[RFC2616], which uses a MIME-like mechanism).

    Interesting... Not exactly sure what it means, but food for thought.

提交回复
热议问题