ajax GET failing when JSON content over 1MB on GoDaddy host

谁说我不能喝 提交于 2019-12-01 10:56:52

Well I stumbled onto a solution. It was to add a header statement just before the echo which seems to allow the echo to be larger than 1MB.

header("Content-Type: application/json");
echo json_encode(array(array("date_code" => $ftime), $chargers));

I now need to understand this more and check it across various browsers. Also interesting that the data was returned as an object now so no need to do json decode on it.

I suspect there is something in the GoDaddy service that defaulted the length but I am not sure. Again my server did not behave this way.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!