i found a way to perform a working REST call to Parse server
public function runParseCloudFunction(cloudFunctionName:String):void
{
if (parseRequestor != null){
return;
}
//Create the HTTP request object
var request:URLRequest = new URLRequest( "https://api.parse.com/1/functions/" + cloudFunctionName );
request.method = URLRequestMethod.POST;
// Create Parse headers
var headerAppID:URLRequestHeader = new URLRequestHeader("X-Parse-Application-Id", MY_PARSE_APP_ID);
var headerRestKey:URLRequestHeader = new URLRequestHeader("X-Parse-REST-API-Key", MY_PARSE_REST_KEY);
var headerContentType:URLRequestHeader = new URLRequestHeader("Content-Type", "application/json");
request.requestHeaders.push(headerAppID);
request.requestHeaders.push(headerRestKey);
request.requestHeaders.push(headerContentType);
//Add the URL variables, json encoded format (OPTIONAL)
request.data = '{"param1":"sample1","param2":"sample2","param3":"sample3"}';
//Initiate the transaction
parseRequestor = new URLLoader();
//requestor.dataFormat = URLLoaderDataFormat.TEXT;
parseRequestor.addEventListener( Event.COMPLETE, callParseCloudFunctionCompleted );
parseRequestor.addEventListener( IOErrorEvent.IO_ERROR, callParseCloudFunctionError );
parseRequestor.addEventListener( SecurityErrorEvent.SECURITY_ERROR, callParseCloudFunctionError );
parseRequestor.addEventListener( HTTPStatusEvent.HTTP_STATUS, callParseStatusHandler);
parseRequestor.load( request );
}
Tested with cloud parse api version 1.3.2
Hope it helps!!