{ "id": "63307", "key": "TIMOB-2675", "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": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:59:47.000+0000", "created": "2011-04-15T03:26:37.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "content-type", "headers", "ios", "release-1.6.0", "rplist", "xhr" ], "versions": [], "issuelinks": [], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:59:47.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}
Self-explanitory. Sample code from #1983:
\n\nvar xhr = Titanium.Network.createHTTPClient();\nxhr.onload = function()\n{\n Ti.API.info('I am in utf-8 onload for POST');\n};\nxhr.onerror = function()\n{\n Ti.API.info('I am in utf-8 error for POST');\n};\nxhr.setRequestHeader(\"setoutside\", \"one\");\nxhr.open(\"POST\",\"http://api.localmedia.fm/files/endpoint_webform.cfm\");\nxhr.setRequestHeader(\"content-type\", \"multipart/form-data\");\nxhr.setRequestHeader(\"setinside\", \"two\");\nxhr.send({\"a\":\"hi\", \"b\":\"there\"});
\n
\nThe response is always:
\n\nContent-Type application/x-www-form-urlencoded; charset=utf-8
\n
\nShould be considered part of the XHR refactor.
@stephen, Any sort of an ETA on this bug being fixed? I'd rather\ngo through this app store approval process once, so if it is coming\nsoon then I will hang tight for a fix, if not then I should\nprobably remove camera support from my app and go ahead and get the\napp submitted without it. Just give me an idea of how\ncomplicated/important this bug fix is to you guys right now.\nThanks.
It will be fixed for 1.6.0. There is no other timeline on this\nbug.
Ticket is targeted to be fixed by Jan 17, but there are no\nguarantees.
Jan 17th is the target date for 1.6?
Thanks Stephen. I'll hang tight, really appreciate the help,\nthis is a bit of a blocker for me.
No. Only this ticket is targeted for that date.
Assigned to somebody else so moved to M06.
(from [623a1f982c3f4107d250179d52bd9ccbe3374994])\n[#2675 state:fixed-in-qa] Allow setting of\n'Content-Type'. \nhttps://github.com/appcelerator/titanium_mobile/commit/623a1f982c3f...
Two things to note:
\nI see the code has been committed, at what point are these fixes\npicked up by nightly builds for testing? I assume \"fixed-in-qa\" is\nan internal thing? Thanks a bunch this should allow me to move\nforward.
I saw in the continuous build that this change was in there so I\ngave it a shot:
\nvar xhr = Titanium.Network.createHTTPClient();\nxhr.onload = function()\n{Ti.API.info('onLoad for POST, firing event with data: ' + this.responseText);};\nxhr.onerror = function()\n{Ti.API.info('I am in utf-8 error for POST');};\nxhr.open(\"POST\",\"http://api.localmedia.fm/files/test.cfm\");\nxhr.setRequestHeader(\"Content-Type\", \"multipart/form-data\");\nxhr.send({\"a\":\"hi\", \"b\":\"there\"});
\n
\nIt appears as though it is still broke though. If I run the code\nabove I get:\n[INFO] onLoad for POST, firing event with data: undefined
\n
\nIf I comment out the setRequestHeader() then it goes through fine\n:(As indicated in this ticket we do not support multipart\nmessages. There is no timeline for this feature.
Any fresh ideas on letting the user POST photos that the user\ntakes to my server? Seems like something pretty basic I want to do\nhere? Additionally, it would have been nice to know this a month\nago when this ticket was opened so I could have asked this question\nback then.
The customer's issue hasn't been fixed. The original code\nincludes \"multipart/form-data\" as the content type, so I'm not sure\nwhy this is marked as fixed-in-qa when I believe it isn't.
\nPlease let me know if you would like an additional ticket\ncreated for supporting multipart messages.
Supporting multipart mime is a different issue from \"Can't set\nContent-Type request header.\" The bug, as described in the original\nticket, is fixed.
\nCreate a second bug for multipart support.
Initial bug fixed.
\nTested on iPhone Simulator 4.2 with code provided
\nTi SDK 1.6 (Jan 27 2011 16:11 rc27ef530)
I've added a new bug report ((#3145)) for the multipart\nsupport.