[Catalyst] Catalyst::View::JSON sends a file

Edmund von der Burg edmund.vonderburg at gmail.com
Thu Jan 14 13:37:38 GMT 2010


2010/1/12 Tomas Doran <bobtfish at bobtfish.net>:
> Your browser will do whatever it normally does with the mime type you're sending.
>
> By changing settings or mime types you'll probably be able to convince it to display the JSON.

Or just install the FireFox addon 'JSONView' which will show you the
JSON in the browser window in the same way that you see XML (with
pretty colours and stuff).

This is best as it puts the smarts where you want them (in your
browser) rather than in the app where the unintended consequences kick
in.

Cheers,
  Edmund.

PS: as a side note you're being asked to download a file because the
mime-type for JSON is 'application/json' so the browser assumes that
it is not human readable. There is a chirpy little holy war about all
the mime-types that are 'text/*' that should actually be
'application/*' - like 'text/xml' for example. But I digress...



More information about the Catalyst mailing list