{ "id": "112849", "key": "TIMOB-13555", "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": "15646", "description": "2013 Sprint 18", "name": "2013 Sprint 18", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15674", "description": "2013 Sprint 18 Tooling", "name": "2013 Sprint 18 Tooling", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-30T18:50:53.000+0000", "created": "2013-04-15T11:59:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-03-14T21:13:48.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "h2. Problem description\r\nWhen trying to change the Content-Type of the HTTPClient request (e.g. to set it to application/json), the header sent still contains the default application/json,application/x-www-form-urlencoded value, in addition to what was set.\r\n\r\nh2. Steps to reproduce\r\n\r\nUse the following code:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar xhr = Ti.Network.createHTTPClient({\r\n\tonload : function(e) {\r\n\t\tTi.API.info('onload called, readyState = ' + this.readyState);\r\n\t},\r\n\tonerror : function(e) {\r\n\t\tTi.API.info('onerror called, readyState = ' + this.readyState);\r\n\t},\r\n\ttimeout : 30000 /* in milliseconds */\r\n});\r\nxhr.open(\"POST\", 'http://127.0.0.1:8020/');\r\nxhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\nxhr.send({\r\n\t\"CountryCode\" : \"ITA\"\r\n});\r\n{code}\r\n\r\nWhen running the code in MobileWeb, the Content-Type header will contain:\r\n\r\nContent-Type: application/json, application/x-www-form-urlencoded\r\n\r\nh2. Additional notes\r\nAccording to the XMLHttpRequest specifications, setRequestHeader will add the request header when called, and not replace it. Apparently, \"application/x-www-form-urlencoded\" is always set if any data is sent.", "attachment": [], "flagged": false, "summary": "MobileWeb: Cannot change Content-Type passing an object in the send() method of Ti.Network.HTTPClient", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "MobileWeb\r\nSDK 3.0.2\r\nChrome", "comment": { "comments": [ { "id": "265081", "author": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "body": "I'm able to reproduce this on iOS using Ti SDK 3.1.1.GA. Android works just fine.\n\n\nWe're seeing this as an issue for a prospect as well.", "updateAuthor": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "created": "2013-08-06T11:03:03.000+0000", "updated": "2013-08-06T11:03:03.000+0000" }, { "id": "265144", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/4546", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T17:30:21.000+0000", "updated": "2013-08-06T17:30:21.000+0000" }, { "id": "265145", "author": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "body": "Hey Bryan -\n\nNote that i'm seeing this with iOS as well - should i open a seperate ticket for it?\n", "updateAuthor": { "name": "bgrantges@appcelerator.com", "key": "bgrantges", "displayName": "Bert Grantges", "active": false, "timeZone": "America/Chicago" }, "created": "2013-08-06T17:31:51.000+0000", "updated": "2013-08-06T17:31:51.000+0000" }, { "id": "265159", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Bert,\n\nYes, please do open a new ticket.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T18:32:56.000+0000", "updated": "2013-08-06T18:32:56.000+0000" }, { "id": "266896", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4578", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-16T17:14:55.000+0000", "updated": "2013-08-16T17:14:55.000+0000" }, { "id": "266897", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening for the 3.1.3 backport PR", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-16T17:15:18.000+0000", "updated": "2013-08-16T17:15:18.000+0000" }, { "id": "267943", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Worked with Bryan, and with the sample code above, not seeing any content-type in the request header.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-23T20:51:08.000+0000", "updated": "2013-08-23T20:51:08.000+0000" }, { "id": "269037", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~bhughes] Is this supposed to be resolved?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-30T16:02:58.000+0000", "updated": "2013-08-30T16:02:58.000+0000" }, { "id": "412333", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-14T21:13:48.000+0000", "updated": "2017-03-14T21:13:48.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }