什麼是正確的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?
相關文章
相關標籤/搜索