Project: titanium
Issue TIMOB-19030: Android: HttpClient setOnload() and setOnerror() methods do not work
h5.Reproduce Step: 1.Simple run the following code in a classic mobile project. {code:title=app.js} var url = "http://www.appcelerator.com"; var client = Ti.Network.createHTTPClient({ timeout : 5000 // in milliseconds }); client.setOnload(function(e) {	Ti.API.info("Received text: " + this.responseText); alert('success'); }); client.setOnerror(function(e) {	Ti.API.debug(e.error); alert('error'); }); // Prepare the connection. client.open("GET", url); // Send the request. client.send(); {code} h5.Expect Result: Should fire alert event. Like its behaviour in iOS h5.Acutal Result: Return a error, like this: {code:title=error log} [ERROR] : TiExceptionHandler: (main) [100,100] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,100] - In app.js:413,9 [ERROR] : TiExceptionHandler: (main) [0,100] - Message: Uncaught TypeError: Object # has no method 'setOnload' [ERROR] : TiExceptionHandler: (main) [1,101] - Source: client.setOnload(function(e) { [ERROR] : V8Exception: Exception occurred at app.js:413: Uncaught TypeError: Object # has no method 'setOnload' {code}
Story points: 5