标题类型更改为application / json不更改

时间:2014-11-19 05:53:21

标签: php api rest mobile

标题类型 回复“text / html”“application / json”。其他此

正在使用标题类型 header(“Content-Type”,“application / json; charset = UTF-8”)

但不要改变。

Status Code: 200 OK
Connection: keep-alive
Content-Type: text/html
Date: Wed, 19 Nov 2014 05:49:55 GMT
Server: Apache mod_fcgid/2.3.10-dev
Vary: User-Agent
Via: 1.1 (external)pdc.amw.lan (squid/3.3.8), 1.1 (frontal)pdc.amw.lan (squid/3.3.8)
X-Cache: MISS from (external)pdc.amw.lan, MISS from (frontal)pdc.amw.lan
X-Cache-Lookup: MISS from (external)pdc.amw.lan:3130, MISS from (frontal)pdc.amw.lan:0
X-Powered-By: PHP/5.4.34

1 个答案:

答案 0 :(得分:0)

按如下方式设置标题,而不是像header("Content-Type", "application/json;charset=UTF-8")

header("Content-Type: application/json");