Project: titanium
Issue TIMOB-18423: iOS: HTTPClient: setRequestHeader('X-Requested-With', null) ignored in iOS
h6.Issue Description When a Titanium HTTPClient request is opened and sent, the header "X-Requested-With: XMLHttpRequest" is sent with the request by default. This usually is not a problem, however, this header currently results in an error message being returned from the particular API that I'm using (shopify API). I've set this header to null in my controller code, which fixes the problem in Android, but not in iOS as the X-Requested-With header is still being set in iOS. h6.Test Case {code} var url = 'https://shopname.myshopify.com/admin/products.json'; var client = Ti.Network.createHTTPClient({	timeout : 5000,	withCredentials : true,	validatesSecureCertificate : true }); client.onload = function(e) {	Ti.API.info("Received text!" + this.responseText); }; client.onerror = function(e) {	Ti.API.debug("error");	Ti.API.debug(e); }; client.onreadystatechange = function(e) {	Ti.API.info("state changed");	Ti.API.info(this.readyState);	Ti.API.info(client.getAllResponseHeaders());	Ti.API.info("************"); }; client.setUsername("user"); client.setPassword("pass"); client.open("GET", url); client.setRequestHeader('X-Requested-With', null); client.send(); {code} h6.Request Raw Response {quote} GET /admin/products.json HTTP/1.1 Host: shopname.myshopify.com X-Titanium-Id: f2e11973-5eac-4106-b95d-6690ddd8683e X-Requested-With: XMLHttpRequest Proxy-Connection: keep-alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-us Connection: keep-alive User-Agent: Appcelerator Titanium/3.4.1 (iPhone Simulator/8.1; iPhone OS; en_US;) {quote}
Story points: 5