[Web] JSON正确的MIME header

博客首页 » Web JSON正确的MIME header

发布于 17 Dec 2014 22:34
标签 blog
What is the correct JSON content type?

http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type

For JSON text:

The MIME media type for JSON text is application/json. The default encoding is UTF-8. (Source: RFC 4627).

For JSONP with callback:

application/javascript
Here are some blog posts that were mentioned in the comments that are relevant.

Why you shouldn't use text/html for JSON
Internet Explorer sometimes has issues with application/json
A rather complete list of Mimetypes and what to use them for
https://github.com/h5bp/server-configs-nginx/blob/master/mime.types


本页面的文字允许在知识共享 署名-相同方式共享 3.0协议和GNU自由文档许可证下修改和再使用,仅有一个特殊要求,请用链接方式注明文章引用出处及作者。请协助维护作者合法权益。


系列文章

文章列表

  • Web JSON正确的MIME header

这篇文章对你有帮助吗,投个票吧?

rating: 0+x

留下你的评论

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License