3 ms·
Please serve JSON with the application/json content-type, not text/html. If you want to debug it more easily in a browser, you can install the JSONView Firefox
by IsaacSchlueter 17y ago
Please serve JSON with the application/json content-type, not text/html.
If you want to debug it more easily in a browser, you can install the JSONView Firefox extension. It's quite handy: https://addons.mozilla.org/en-US/firefox/addon/10869 https://addons.mozilla.org/en-US/firefox/addon/10869
- qeorge 17y agoUnfortunately, IE chokes on application/json. So its actually safer to use application/javascript, or even text/html instead. This was still present in IE7, but they may have fixed it in IE8.
- diN0bot 17y agothen let IE choke.
- bkudria 17y agoUm, so? Why exactly would you be using IE to retrieve JSON? It's an API, right?
- litewulf 17y agoPresumably as part of an AJAX request?
- qeorge 17y agoThere's all kinds of client side uses for APIs. Facebook Connect logins for instance, which can't be initiated server side. Sending application/json to older versions of IE can cause it to pop up Save As dialogs, even in AJAX requests. They did the same thing with application/xml+xhtml.
- i386 17y agoHow about serve up different mime types for different agents? That way its only broken for the broken browser.