[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Header type



Bruce McKenzie wrote:
> This question would actually sort of fit into the Ajax thread which is
> under the subject "Test 2 - is this thing on" :-)
> 
> Anyway, should I be changing the header type when returning JSON or
> something other than HTML from CAP?

If you used CAP::JSON (another plug) you wouldn't have to worry about this:

return $self->json_body({ foo => 'stuff', bar => [0,1,2,3]} );

But yes you do need to change it. I usually use "text/x-json", but there are a
couple of derivatives that will work as well.

-- 
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.