javascript - What problems may using the MIME type application/json cause? -
i working on web service needs return json data. i read should use application/json not sure problems may cause?
for example, older browsers support it? (ie6+, ff, opera, etc.)
or possible users behind corporate firewalls/proxy servers block mime type application/json?
what, if any, problems have had following advice?
let's consider ie. have hidden iframe use request file download. example
<iframe src="getfile?id=123">
now, server may send json-encoded error message like
{ error: 'file 123 not exist', retrylater: false }
if error message sent application/json
, download dialog appear, because json text mistaken actual file.
on other hand, mime type of text/plain
cause message rendered in iframe, , can extract it, , transform fancy pop-up or using jscript.
(edit)
real-world example: extjs fileupload - problem ie8 security bar
Comments
Post a Comment