Project: titanium
Issue TIMOB-19129: Windows: HTTPClient does not send User-Agent
The following example shows that on Windows is not sending the {{User-Agent}} header (as well as {{X-Titanium-Id}}) like iOS and Android do. Many API's require this header to be set. {code:javascript} var win = Ti.UI.createWindow(); var btn = Ti.UI.createButton({	title: 'Click' }); btn.addEventListener('click', function (e) {	var client = Ti.Network.createHTTPClient();	client.open('GET', 'http://requestb.in/1fv1js61');	client.send(); }); win.add(btn); win.open(); {code} h2. Windows {code} Host: requestb.in Connection: close X-Request-Id: 94581c18-95ea-468a-966d-0cf914d68859 Via: 1.1 vegur Total-Route-Time: 0 Connect-Time: 0 Accept-Encoding: gzip, deflate {code} h2. iOS {code} User-Agent: Appcelerator Titanium/4.1.0 (iPhone/8.4; iPhone OS; nl_NL;) Via: 1.1 vegur Connection: close Accept: */* Accept-Language: nl-nl X-Request-Id: 600421ac-e5e7-4d10-9c48-2eabfab4489b Connect-Time: 1 Host: requestb.in Total-Route-Time: 0 X-Titanium-Id: 92e3ee1a-2507-4c54-b3a0-3af19ccf0661 Accept-Encoding: gzip, deflate X-Requested-With: XMLHttpRequest {code} h2. Android {code} X-Request-Id: e5cd2daa-9796-478f-924c-e8578edd6cdd X-Requested-With: XMLHttpRequest X-Titanium-Id: 92e3ee1a-2507-4c54-b3a0-3af19ccf0661 Connection: close Host: requestb.in Via: 1.1 vegur Total-Route-Time: 0 User-Agent: Appcelerator Titanium/4.0.0 (Nexus 5; Android API Level: 22; nl-NL;) Connect-Time: 0 {code}
Story points: 5