CakePHP dumps out a table of data when debug level is set to 2...this obviously won't be valid JSON. Not sure why the headers would change though.
On Wed, Nov 11, 2009 at 1:38 PM, Alberto Dominguez < [email protected]> wrote: > Hi, > > I'm using CakePHP to generate JSON responses. I'm also using FirePHP > to debug and log the application execution. It works pretty well, > however when I set the DEBUG level to 2 o higher -i.e. when I need to > monitor the DB query executions- it suddenly changes the response > header content type to HTML (Content-Type: text/html). > > I'm looking at several files, but I cannot find where it is being > changed. > > Implementation Notes > > 1. My JSON implementation is really close to match the one presented > at http://www.pagebakers.nl/2007/06/05/using-json-in-cakephp-12/ > 2. CakePHP is successfully debugging and logging to FirePHP -even when > I change the debug level from 1 to 2. > 3. FireBug is the tool I use to monitor the HTTP communication > 4. I'm setting the JSON content type at "RequestHandlerComponent" > 5. I'm using JSONView extension at Firefox to validate the output > (obviously it doesn't work when content type is set to text/html > > -- > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/cake-php?hl=. > > > -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cake-php?hl=.
