I need to create some webservices that will be called by either ajax calls from within our site or API calls coming from another server, and will reply with a JSON.
Is there an established best practice?
Digging in the code i found two different ways to do that:
if( $this->_getParam(‘sendNow’, true) )
$data = Zend_Json::encode($data);
I assume the difference must be in how the dispatchment loop will proceed after the generation of the JSON but I’m not sure - do you know?