[AC-1161] HTTPClient methods undefined on Android
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Resolved |
| Resolution | Invalid |
| Resolution Date | 2014-05-19T05:58:09.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | android, httpclient |
| Reporter | Dmitri |
| Assignee | Ritu Agrawal |
| Created | 2014-05-13T16:33:47.000+0000 |
| Updated | 2016-03-08T07:37:31.000+0000 |
Description
After creating a HTTPClient object on android, all methods are undefined.
For example, this works fine on iOS, shows "method undefined" for Android:
var httpClient = Ti.Network.createHTTPClient();
httpClient.setOnload(function(e) { // Stuff });
httpClient.setOnerror(function(e) { // More Stuff });
httpClient.open("GET", url);
httpClient.send();
You should be using onload and onerror as documented here: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient