{ "id": "89704", "key": "TIMOB-8612", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-04-08T16:19:38.000+0000", "created": "2012-04-09T09:08:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "supportTeam" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": null, "updated": "2019-04-08T16:19:38.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": "h3. Problem\r\n\r\nThe HTTPClient does not seem to be able to get the responseText/headers from the server in onerror response(the console shows everything I print in the example below as null).\r\n\r\nh3. Code\r\n\r\n{noformat}\r\nvar xhr = Titanium.Network.createHTTPClient({\r\n 'timeout': 5000\r\n});\r\n \r\nxhr.onerror = function() {\r\n if (this.status == 401) {\r\n //auth challenge required\r\n var guid = xhr.getResponseHeader('X-Challenge-GUID');\r\n Titanium.API.info('Server gave GUID challenge of: \"' + guid + '\"');\r\n Titanium.API.info('TEST FOO: ' + xhr.getResponseHeader('X-Custom-Header'));\r\n Titanium.API.info('TEST BAR: ' + this.getResponseHeader('Cache-Control'));\r\n Titanium.API.info('TEST BLA: ' + xhr.responseText);\r\n Titanium.API.info('TEST BOO: ' + this.responseText);\r\n }\r\n}\r\n \r\nxhr.open(\"GET\", url);\r\nxhr.send();\r\n{noformat}\r\n\r\nThe getResponseHeader is responding as null. The onload method works fine but on trying to get the data from onerror \"null\" is returned.\r\n\r\n\r\nh3. Related Community Ticket\r\n\r\nhttp://developer.appcelerator.com/question/50501/problem-getting-responsetextheaders-from-error-response\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: Problem getting responseText/headers from onerror response", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Platform OS: iOS ver 5.0\r\nTitanium SDK: 1.8.2 / CI build\r\nTi SDK 3.2.1.GA\r\nTi CLI 3.2.0\r\n", "comment": { "comments": [ { "id": "447525", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not reproducible. The code missing a statement, no URL set. Website will return a 401 error and then set the url to that and then run.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-08T16:19:38.000+0000", "updated": "2019-04-08T16:19:38.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }