{ "id": "60758", "key": "TIMOB-126", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11216", "name": "Release 0.8.0", "archived": true, "released": true, "releaseDate": "2009-11-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:52:05.000+0000", "created": "2011-04-15T02:24:02.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "network" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:52:05.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
When I try to check this.status (or this.getStatus()) from\nwithin a onreadystatechange function, I always seem to get 0,\nalthough I believe that I should be getting either 200 or 401.\nConsider the following example using the twitter API:
\n$('#login').click(function()
\n\n{\n notify(\"Login Clicked\");\n var query = \"twitter.com/account/verify_credentials.json\";\n var xhr = Titanium.Network.createHTTPClient();\n xhr.onreadystatechange = function(){\n if (this.readyState == 4 )\n {\n notify(\"Status: \"+this.status);\n }\n };\n xhr.open('GET',\n \"http://\"+$('#username').val()+\":\"+$('#password').val()+\"@\"+query);\n xhr.send();\n});
\n
\nBased on the HTTPClient documentation, I'd expect to get either\n200 or 401 for a status, depending on whether the authentication\nwas successful. Judging from the JSON response, I can tell that I\nauthenticate correctly or incorrectly for a given username or\npassword, but the status code does not seem to reflect what twitter\nreturns.
\nThanks.
is this for iphone, android or both?
this has been fixed for iphone but still wrong on android.
(from [a6f6295b1efc296cad22d2710cac094d6b8c921e])\n[#126\nstate:resolved] Added check for no header value. Was getting NPE on\ntrying to access a header that didn't exist. \nhttp://github.com/appcelerator/titanium_mobile/commit/a6f6295b1efc2...