什么是正确的JSON内容类型?

问题:

I've been messing around with JSON for some time, just pushing it out as text and it hasn't hurt anybody (that I know of), but I'd like to start doing things properly. 我一直在弄乱JSON一段时间,只是将其做为文本推出,并无伤害任何人(据我所知),可是我想正确地作事。 javascript

I have seen so many purported "standards" for the JSON content type: 我见过这么多的所谓的“标准”为JSON内容类型: java

application/json
application/x-javascript
text/javascript
text/x-javascript
text/x-json

But which one is correct, or best? 可是哪个是正确的,仍是最好的? I gather that there are security and browser support issues varying between them. 我发如今它们之间存在安全性和浏览器支持问题。 json

I know there's a similar question, What MIME type if JSON is being returned by a REST API? 我知道有一个相似的问题, 若是REST API返回JSON,则为哪一种MIME类型? , but I'd like a slightly more targeted answer. ,但我想要一个更有针对性的答案。 api


解决方案:

解决方案一: 什么是正确的JSON内容类型?
解决方案二(英文): What is the correct JSON content type?
相关文章
相关标签/搜索