client 端傳入陣列,server 端卻收不到陣列

allenplay 发布于 2015/09/14 15:02
阅读 296
收藏 0

您好,想請問一個問題,我試著用 Flash CS6 Action Script 3.0,串接hprose,傳入字串參數,皆可正常在伺服端(php)接收到,但傳入陣列型態,在伺服端無法取得值,提供AS3我的代碼,是我呼叫方式錯誤嗎?


import com.adobe.crypto.*;
import flash.utils.getTimer;
import hprose.client.HproseHttpClient;

var arrApp:Array = new Array();
var Now = new Date();
var timestamp = Now.getTime();

arrApp['appid'] = "123456789";
arrApp['sign'] = SHA1.hash("987654321" + timestamp );
arrApp['timestamp'] = timestamp;

for(var loop in arrApp)
{
	trace(loop+":"+arrApp[loop]);
}
var client:HproseHttpClient = new HproseHttpClient('http://demo.com/api');

var hello = client.run('test','hello', ['john'], arrApp, function(strResult){
					   	trace(strResult);
					   });




加载中
0
inuxor
inuxor
原本是传字符串的地方你传进去数组,如果HproseHttpClient :: run方法没做自动转换,那应该是不成的
返回顶部
顶部