[TIMOB-2675] Can't set Content-Type request header
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M06 |
Components | iOS |
Labels | content-type, headers, ios, release-1.6.0, rplist, xhr |
Reporter | Stephen Tramer |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:26:37.000+0000 |
Updated | 2011-04-17T01:59:47.000+0000 |
Description
Self-explanitory. Sample code from #1983:
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function()
{
Ti.API.info('I am in utf-8 onload for POST');
};
xhr.onerror = function()
{
Ti.API.info('I am in utf-8 error for POST');
};
xhr.setRequestHeader("setoutside", "one");
xhr.open("POST","http://api.localmedia.fm/files/endpoint_webform.cfm");
xhr.setRequestHeader("content-type", "multipart/form-data");
xhr.setRequestHeader("setinside", "two");
xhr.send({"a":"hi", "b":"there"});
The response is always:
Content-Type application/x-www-form-urlencoded; charset=utf-8
Should be considered part of the XHR refactor.
@stephen, Any sort of an ETA on this bug being fixed? I'd rather go through this app store approval process once, so if it is coming soon then I will hang tight for a fix, if not then I should probably remove camera support from my app and go ahead and get the app submitted without it. Just give me an idea of how complicated/important this bug fix is to you guys right now. Thanks.
It will be fixed for 1.6.0. There is no other timeline on this bug.
Ticket is targeted to be fixed by Jan 17, but there are no guarantees.
Jan 17th is the target date for 1.6?
Thanks Stephen. I'll hang tight, really appreciate the help, this is a bit of a blocker for me.
No. Only this ticket is targeted for that date.
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/65171">http://developer.appcelerator.com/helpdesk/view/65171
Assigned to somebody else so moved to M06.
(from [623a1f982c3f4107d250179d52bd9ccbe3374994]) [#2675 state:fixed-in-qa] Allow setting of 'Content-Type'. https://github.com/appcelerator/titanium_mobile/commit/623a1f982c3f4107d250179d52bd9ccbe3374994"> https://github.com/appcelerator/titanium_mobile/commit/623a1f982c3f...
Two things to note:
I see the code has been committed, at what point are these fixes picked up by nightly builds for testing? I assume "fixed-in-qa" is an internal thing? Thanks a bunch this should allow me to move forward.
I saw in the continuous build that this change was in there so I gave it a shot:
It appears as though it is still broke though. If I run the code above I get:If I comment out the setRequestHeader() then it goes through fine :(
As indicated in this ticket we do not support multipart messages. There is no timeline for this feature.
Any fresh ideas on letting the user POST photos that the user takes to my server? Seems like something pretty basic I want to do here? Additionally, it would have been nice to know this a month ago when this ticket was opened so I could have asked this question back then.
The customer's issue hasn't been fixed. The original code includes "multipart/form-data" as the content type, so I'm not sure why this is marked as fixed-in-qa when I believe it isn't.
Please let me know if you would like an additional ticket created for supporting multipart messages.
Supporting multipart mime is a different issue from "Can't set Content-Type request header." The bug, as described in the original ticket, is fixed.
Create a second bug for multipart support.
Initial bug fixed.
Tested on iPhone Simulator 4.2 with code provided
Ti SDK 1.6 (Jan 27 2011 16:11 rc27ef530)
I've added a new bug report ((#3145)) for the multipart support.