How to Send AS3 data to CakePHP
I'm wondering how to send data from AS3 to CakePHP. I k开发者_开发技巧now I can use URLVariables to send data to the URLRequest and ge that data in PHP using the superglobal $_POST. However, for some reason I can't access the variables in a CakePHP action.
In my action I get the data using the following:
echo json_encode(array("response_type" => $responseType,"response" => $response, "data" => $_POST));
but this is what I get in return:
{"response_type":"Error","response":"Data was not sent!","data":[]}
Note: I have set responeType to "Error" and response to "Data was not.." manually.
In AS3 this is what I do:
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.data = params;
loader = new URLLoader();
executeRequest(loader, request);
And this is what I send as my object:
{facebookID:"25"}
try using URLVariables
(as in example)
精彩评论