我想将数据上传到服务器。它会通过,这将返回,我该怎么办? 请帮帮我
代码只是示例
but4.addEventListener('click',function(){
var xhr = Titanium.Network.createHTTPClient({
timeout : '15000',
});
xhr.onload = function (){
Titanium.API.info('onload');
Ti.API.info('Sucess'+ this.status + ' '+ this.readyState);
};
xhr.onerror = function(){
Ti.API.info('error');
res.hide();
};
xhr.ondatastream=function(){
Ti.API.info('ondatastream');
};
var abc1 = 'iPhone_request=<category><name>game_abc</name></category>';
xhr.open('POST','http://www.imobdevtech.com/assignments/uploadcategory.php');
xhr.send(abc1);
});
先谢谢,
答案 0 :(得分:1)
试试这个,我觉得这对你很有帮助,
xhr.send({iPhone_request='<category><name>Game Name</name></category>'});