Home >Backend Development >PHP Tutorial >JSON数据的HTTP Header应该怎么标记?

JSON数据的HTTP Header应该怎么标记?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:50:551121browse

第一种
header('Content-type: application/json');
另一种
header('Content-type: text/json');

这两种有什么使用上的区别吗?

回复内容:

第一种
header('Content-type: application/json');
另一种
header('Content-type: text/json');

这两种有什么使用上的区别吗?

http://stackoverflow.com/questions/47...

application/json是更通用且符合标准的

application/json,这是标准 RFC 4672

第一种是标准兼容以后,第二种兼容IE6

IE6害死人系列

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP to Ruby CodeNext article:mysql实体间的关系分为几种