Ti.Network.createHTTPClient

时间:2012-10-02 14:10:19

标签: android titanium httpclient port appcelerator-mobile

我可以在Titanium移动应用程序中创建使用8080以外的端口的http客户端吗?

我的代码:

var clietn = Ti.Network.createHTTPClient({
    onload: function(e){
      ....
      ....
    },
    onerror: function(e){
      ....
      ....
    },

    timeout: 3000
});

client.open("GET", Ti.App.Properties.getString('srvName', '192.168.4.248:8888'));

client.send(JSON.stringify({....}));

不能按我的意愿行事;

Titanium告诉我:

[ERROR][TiJSError(  343)] (main) [27918,533680] ----- Titanium Javascript Runtime  Error ----
[ERROR][TiJSError(  343)] (main) [0,533680] - In app.js:22,1
[ERROR][TiJSError(  343)] (main) [1,533681] - Message: Uncaught ReferenceError: client is not defined
[ERROR][TiJSError(  343)] (main) [0,533681] - Source: client.open("GET",     Ti.App.Properties.getString('servername', '192.168.4.248:88
[ERROR][V8Exception(  343)] Exception occurred at app.js:22: Uncaught ReferenceError: client is not defined

0 个答案:

没有答案