[TIMOB-4537] iOS: Ability to obtain intermediate response headers when the url is redirected in a xhr request
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-15T18:27:57.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Anirudh Nagesh |
Assignee | Ingo Muschenetz |
Created | 2011-06-30T14:42:07.000+0000 |
Updated | 2017-06-15T18:27:57.000+0000 |
Description
The current getResponseheaders() will return the headers of one url which is called in the xhr request. If the url is redirected to multiple url's, the above function does not return the intermediate response headers. Currently, it returns the header information of the last redirected url.
Step1: Run the code below.
Step2: type in http://google.com in the below link and check the headers.
https://apigee.com/console/others#
You can see that the url is redirected to http://www.google.com
Step3: The code returns header information of http://www.google.com but not http://google.com
var win = Titanium.UI.createWindow();
var button2 = Ti.UI.createButton({
top:90,
title:'xhr get',
height:40
});
win.add(button2);
var client = Titanium.Network.createHTTPClient();
button2.addEventListener('click',function(e)
{
client.onload = function()
{
Titanium.API.info("Loaded! Status: " + this.status);
var contentType = this.getResponseHeader('Set-Cookie');
Titanium.API.info("Content-Type: " + contentType);
alert(contentType);
};
client.open("GET", 'http://google.com');
client.send();
});
win.open();
Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.