I'm using php-express to serve PHP pages that occasionally return content other than text/html. In particular, I have a page which returns JSON, and has a header("Content-type: application/json") statement. However, the headers returned from this request are still text/html, as verified by the network monitor in FireFox, and the fact that prototype.js (which I'm using in the code which reads this response) does not set responseJSON in the Ajax response.
I've gotten around this problem by using prototype.js's evalJSON() function, but this fails to address the issue.
I'm using php-express to serve PHP pages that occasionally return content other than text/html. In particular, I have a page which returns JSON, and has a header("Content-type: application/json") statement. However, the headers returned from this request are still text/html, as verified by the network monitor in FireFox, and the fact that prototype.js (which I'm using in the code which reads this response) does not set responseJSON in the Ajax response.
I've gotten around this problem by using prototype.js's evalJSON() function, but this fails to address the issue.