[FLOW3-general] Ajaxable Actions / JSON as content-type
"Christian Müller (Kitsunet)"
christian.mueller at typo3.org
Mon Sep 19 10:37:09 CEST 2011
On 19/09/11 01:16, David Schoen wrote:
>
> 1. If I use exactly the lines you provided with a call from jQuery I
> won't get Json but html. My guess is that's because jQuery sets the
> header "Accept: application/json, text/javascript, */*; q=0.01". I'm not
> able to tell jQuery to use just "Accept: application/json". Shouldn't
> the controller choose the JsonView if the content-type is
> "application/json" and the accept-header like above? Otherwise nobody
> could use the JsonView with a jQuery.getJson-request and that would be
> sad :)
>
Hi David,
take a look at the routing. You can define the format there (just use
two routes, one for html one for json), that should force it.
Christian
More information about the FLOW3-general
mailing list