Vote count:
0
I'm writing an hybrid app with Cordova and Ionic. My problem is that I want to access a server with an http request and I need to change the user agent of the device to pass a secret key.
$http({
method: 'GET',
url: 'http://ift.tt/1vlvr8Y',
headers: {
'User-Agent' : 'app_name/2.0 (iOS 8.1) secret=75456789087654',
}
}).success(function(data){
alert(data.content);
}).error(function(){
alert("error");
});
But when I look at the logs of the server the user agent didn't change:
"GET /service HTTP/1.1" - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit (KHTML, like Gecko) Chrome Safari" "http://ift.tt/1vlvr8Y"...
asked 1 min ago
Hybrid application: Change HTTP user agent header with AngularJS
Aucun commentaire:
Enregistrer un commentaire