[TIMOB-23127] Windows: Ti.Network.HTTPClient.setRequestHeader is crashing
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-01T12:55:21.000+0000 |
Affected Version/s | Release 5.4.0 |
Fix Version/s | Release 5.3.0 |
Components | Windows |
Labels | n/a |
Reporter | Jörgen Buder |
Assignee | Kota Iguchi |
Created | 2016-03-31T07:53:08.000+0000 |
Updated | 2016-04-15T16:26:45.000+0000 |
Description
the setRequestHeader of the HTTP obj is not working, when used the send() crashes all the time
If I remove the setRequeestHeader and handle the type by default in the back then the send() works again..
We need of course this feature in windows..
Example code:
var http = Ti.Network.createHTTPClient({
onload: function() {
Ti.API.info('API: step onload');
var res = JSON.parse(this.responseText);
},
onerror: function(error) {
Ti.API.info('API: step onerror');
},
timeout: 90000
});
http.open('POST', url);
*// If I unmark the setRequestHEader the below send() crashes..*
//http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send(data);
[~buder] Just for curiosity's sake, what if you use the header name "Content-Type" (case must match) instead of "Content-type"?
Hi Argh, 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.. /Jörgen
Verified using: Windows 10 Pro Visual Studio 2015 Community Update 2 Appc Core: 5.3.0-12 Appc NPM: 4.2.5-1 Ti SDK: 5.3.0.v20160411153728 Windows Phone Emulator 8.1, 10 Lumia 930 10 Lumia 520 8.1 When using setRequestHeader, if the header does not match the expected case then the app no longer crashes and the request is successful
Closing ticket