I m trying to make json response for android application.
Here is the code
$document =& JFactory::getDocument();
$document->setMimeEncoding('application/json');
$document->setCharset('utf-8');
The above code is working fine. but when I add the following code it does not generate any response.
$temp['TOKEN'] = "abc";
$document->setHeadData($temp);
I want to get the same result which can be achieved by followin code.
header('TOKEN:abc');
I cant use the header()
method in my code.