X-JSON is the name of the custom header, not a content-type so header("Content-Type: X-JSON") won't work. You need the X-JSON header set to the JSON string. In PHP, do the following:

    header("X-JSON: $json");

I use Catalyst with the following. It's pretty similar to the PHP code so I expect that to work for you.

    $c->res->headers->header( 'X-JSON' => $json );

On a side note. Is X-JSON a standard or just for prototype? The JSON response can be pretty large. Is stuffing a header a good implementation?

HTH,
John
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to