setRequestHeader failing on android
Trying to manually set a cookie on the iphone fails, the following code works perfectly on android but causes problems on iphone:
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function() {
Ti.API.info('cookie: ' + this.getResponseHeader('Set-Cookie'));
callback(this.responseText);
};
xhr.open(type, url, false);
Ti.API.info(cookie);
xhr.setRequestHeader('Cookie', cookie);
xhr.send(params);
Is there anyway to work around this? I need the authentication token that gets sent in the cookie to retrieve the certain parts of the user profile….