YAML 媒体类型? [英] YAML media type?

查看:36
本文介绍了YAML 媒体类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过 HTTP 发送使用 YAML 结构化的数据时,最合适的媒体类型(正式名称为 MIME 类型)是什么?为什么?

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 or text type that I can see.

例子:

> GET /example.yaml

< Content-Type: ????
<
< --- # Favorite movies
< - Casablanca
< - North by Northwest
< - Notorious

可能的选择:

  • 文本/x-yaml
  • 文本/yaml
  • 文本/yml
  • 应用程序/x-yaml
  • 应用程序/x-yml
  • 应用程序/yaml
  • 应用程序/yml

推荐答案

Ruby on Rails 使用 application/x-yaml 替代 text/yaml (来源).

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

我认为这只是惯例问题,据我所知,没有技术上的原因.

I think it's just a matter of convention, there is no technical why, as far as I can tell.

这篇关于YAML 媒体类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆