{ "id": "159166", "key": "TIMOB-23127", "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": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-01T12:55:21.000+0000", "created": "2016-03-31T07:53:08.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-04-15T16:26:45.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "the setRequestHeader of the HTTP obj is not working, when used the send() crashes all the time\r\n\r\nIf I remove the setRequeestHeader and handle the type by default in the back then the send() works again..\r\n\r\nWe need of course this feature in windows..\r\n\r\nExample code:\r\n{code:javascript}\r\nvar http = Ti.Network.createHTTPClient({\r\n\t\tonload: function() {\r\n\t\t\tTi.API.info('API: step onload');\r\n\t\t\tvar res = JSON.parse(this.responseText);\r\n\t\t\t\r\n\r\n\t\t},\r\n\t\tonerror: function(error) {\r\n\t\t\tTi.API.info('API: step onerror');\r\n\t\t\t\r\n\t\t},\r\n\t\ttimeout: 90000\r\n\t});\r\n\t\r\n\thttp.open('POST', url);\r\n\t*// If I unmark the setRequestHEader the below send() crashes..*\r\n\t//http.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\r\n\thttp.send(data);\r\n{code}", "attachment": [], "flagged": false, "summary": "Windows: Ti.Network.HTTPClient.setRequestHeader is crashing", "creator": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Windows", "closedSprints": [ { "id": 614, "state": "closed", "name": "2016 Sprint 07 SDK", "startDate": "2016-03-26T00:38:56.432Z", "endDate": "2016-04-09T00:38:00.000Z", "completeDate": "2016-04-11T04:41:08.231Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "381177", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~buder] Just for curiosity's sake, what if you use the header name \"Content-Type\" (case must match) instead of \"Content-type\"?", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-03-31T12:55:28.000+0000", "updated": "2016-03-31T12:55:28.000+0000" }, { "id": "381201", "author": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi\r\n\r\nArgh, I will try this now, how ever for Android and iOS the current \"Content-type\" has been working for us without any crashes, I will get back to you. It only crashes for Windows..\r\n\r\n/Jörgen", "updateAuthor": { "name": "buder", "key": "buder", "displayName": "Jörgen Buder", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-31T18:21:28.000+0000", "updated": "2016-03-31T18:21:28.000+0000" }, { "id": "382409", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nWindows 10 Pro\r\nVisual Studio 2015 Community Update 2\r\nAppc Core: 5.3.0-12\r\nAppc NPM: 4.2.5-1\r\nTi SDK: 5.3.0.v20160411153728\r\nWindows Phone Emulator 8.1, 10\r\nLumia 930 10\r\nLumia 520 8.1\r\n\r\nWhen using setRequestHeader, if the header does not match the expected case then the app no longer crashes and the request is successful\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor:'red'});\r\n\r\nwin.addEventListener('open', function() {\r\n var http = Ti.Network.createHTTPClient({\r\n onload: function() {\r\n Ti.API.info('API: step onload');\r\n alert('ok')\r\n // var res = JSON.parse(this.responseText);\r\n Ti.API.info('x' + res);\r\n },\r\n onerror: function(error) {\r\n Ti.API.info('API: step onerror');\r\n\r\n },\r\n timeout: 90000\r\n });\r\n\r\n http.setRequestHeader(\"content-type\", \"application/x-www-form-urlencoded\");\r\n http.setRequestHeader(\"accept\", \"text/html\");\r\n http.open('POST', 'http://www.appcelerator.com/');\r\n\r\n http.send('TIMOB-23127');\r\n});\r\nwin.open();\r\n{code}\r\n\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor:'red'});\r\n\r\nwin.addEventListener('open', function() {\r\n var http = Ti.Network.createHTTPClient({\r\n onload: function(e) {\r\n Ti.API.info('API: step onload');\r\n alert('ok');\r\n },\r\n onerror: function(error) {\r\n Ti.API.info('API: step onerror');\r\n\r\n },\r\n timeout: 90000\r\n });\r\n\r\n \thttp.setRequestHeader('authorization', 'Basic dXNlcjpwYXNzd2Q=');\r\n http.open('GET', 'http://httpbin.org/basic-auth/user/passwd');\r\n\r\n http.send();\r\n});\r\nwin.open();\r\n{code}\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-04-12T04:27:43.000+0000", "updated": "2016-04-12T04:27:43.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }