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

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

WBOY
Release: 2016-06-06 20:50:55
Original
1118 people have browsed it

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

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

回复内容:

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

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

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

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

application/json,这是标准 RFC 4672

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

IE6害死人系列

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template