{ "id": "130364", "key": "AC-1161", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-05-19T05:58:09.000+0000", "created": "2014-05-13T16:33:47.000+0000", "labels": [ "android", "httpclient" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:31.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "After creating a HTTPClient object on android, all methods are undefined.\r\n\r\nFor example, this works fine on iOS, shows \"method undefined\" for Android:\r\n\r\nvar httpClient = Ti.Network.createHTTPClient();\r\nhttpClient.setOnload(function(e) { // Stuff });\r\nhttpClient.setOnerror(function(e) { // More Stuff });\r\nhttpClient.open(\"GET\", url);\r\nhttpClient.send();", "attachment": [], "flagged": false, "summary": "HTTPClient methods undefined on Android", "creator": { "name": "dmitri_a", "key": "dmitri_a", "displayName": "Dmitri", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dmitri_a", "key": "dmitri_a", "displayName": "Dmitri", "active": true, "timeZone": "America/New_York" }, "environment": "Tested with 3.2.3.GA and 3.2.2.GA", "comment": { "comments": [ { "id": "304751", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You should be using onload and onerror as documented here:\r\nhttp://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient\r\n\r\n{code}\r\nvar url = \"http://www.appcelerator.com\";\r\n var client = Ti.Network.createHTTPClient({\r\n // function called when the response data is available\r\n onload : function(e) {\r\n Ti.API.info(\"Received text: \" + this.responseText);\r\n alert('success');\r\n },\r\n // function called when an error occurs, including a timeout\r\n onerror : function(e) {\r\n Ti.API.debug(e.error);\r\n alert('error');\r\n },\r\n timeout : 5000 // in milliseconds\r\n });\r\n // Prepare the connection.\r\n client.open(\"GET\", url);\r\n // Send the request.\r\n client.send();\r\n{code}", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-14T04:53:03.000+0000", "updated": "2014-05-14T04:53:03.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }