Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (headers)
Viewing all articles
Browse latest Browse all 14

Can't use getResponseHeader()

$
0
0

I want to use Titanium.Network.createHTTPClient() to download a media file from a web server and save it locally. The URL's being used do not provide any clue as to what type file is being transfered. The filename and type is included in the response header. When I try to access the headers using getResponseHeader('Content-Type');, I get NULL. No matter what value I send to getResponseHeader I get NULL. I am attempting to do all this in onload. I've tried the following:

xhr.onload = function(e) {
 
Ti.API.info("Onload:"+e); //Does nothing, Ti.API.info broken.
alert(e.getResponseHeader('Content-Type'); // NULL
alert(xhr.getResponseHeader('Content-Type'); // NULL
alert(this.getResponseHeader('Content-Type'); // NULL
}
How do I gain access to the response headers?

Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>