Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4537] iOS: Ability to obtain intermediate response headers when the url is redirected in a xhr request

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-15T18:27:57.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterAnirudh Nagesh
AssigneeIngo Muschenetz
Created2011-06-30T14:42:07.000+0000
Updated2017-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();

Comments

  1. Lee Morris 2017-06-15

    Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.

JSON Source