I am trying to send authorization info in a header using Angular $http.get.
If I call $http.get without config, it send the request only once.
As soon as I add a config with header info, it sends the request twice to the server. Once without the authorization header and the second time with.
Here is my code:
var config = {
headers: {
Authorization: authorization
},
withCredentials: true
};
$http.get(url, config).success(function (response) {
$scope.records = validateResponse(response);
});
How can I get it to send only one request with the header information?