[]关于HttpRequest
看了一下HttpRequest的API 发现发送的数据支持方式有点少
例如 如果是下面这样的结构 就不好发给服务器
例如 如果是下面这样的结构 就不好发给服务器
var obj: Object = {
name: "stone",
list: [1, 2, 3],
items: [
{
id: 1,
count: 10
},
{
id: 2,
count: 0
}
]
};
没有找到相关结果
已邀请:
3 个回复
callback
赞同来自:
cuixueying
赞同来自:
callback
赞同来自:
var obj: Object = {
name: "stone",
list: [1, 2, 3],
items: [
{
id: 1,
count: 10
},
{
id: 2,
count: 0
}
]
};
// var s: string = JSON.stringify(obj);
var s:string = CommonUtils.urlEncode(obj);
var hr = new Laya.HttpRequest();
hr.once(Laya.Event.PROGRESS, this, function (e) {
console.log(e);
});
hr.once(Laya.Event.COMPLETE, this, function () {
console.log(hr.data);
});
hr.once(Laya.Event.ERROR, this, function (e) {
console.log(e);
});
hr.send('http://stone.tt.be-xx.com/git/test.php', s, 'post', 'text');
Log.trace(s);
怎么转 我这样转的 但是后端收到的数据感觉不对呢
具体看图