JSON_CONTENT_TYPE
JSON_CONTENT_TYPE
the content-type string indicating a JSON content
Enables amfPHP to receive and reply with JSON This plugin can be deactivated if the project doesn't need to support JSON strings and returned as JSON strings using POST parameters.
You must add the 'application/json' content type, or set it in the headers so that it is recognized as a call to be handled by this plugin. for example: http://yourserver.com/Amfphp/?contentType=application/json
Here is some sample code using Javascript with JQuery:
var callDataObj = {"serviceName":"PizzaService", "methodName":"getPizza","parameters":[]};
var callData = JSON.stringify(callDataObj);
$.post("http://yourserver.com/Amfphp/?contentType=application/json", callData, onSuccess);
Requires at least PHP 5.2.
handleDeserializedRequest(array $deserializedRequest, \Amfphp_Core_Common_ServiceRouter $serviceRouter) : \the
Retrieve the serviceName, methodName and parameters from the PHP object representing the JSON string call service
array | $deserializedRequest | |
\Amfphp_Core_Common_ServiceRouter | $serviceRouter |
service call response