Hello,
I’ve following for $http headers on angularjs documentation, but i never success when implementing in my program. by the way i’m using Basic authentication.
I put headers in config, here we go
.factory('authInterceptor', function($location, $q) {
return {
request: function(config) {
config.headers = config.headers || {};
config.headers.Authorization = "Basic "+ btoa("admin:1234");
return config;
}
};
})
.config(function($stateProvider, $urlRouterProvider, $httpProvider, $translateProvider, localStorageServiceProvider) {
$httpProvider.interceptors.push('authInterceptor');
})
It’s should be sent Authorization headers every http request, but when i looking for it there is nothing.
This is the screenshot
Sincerely,
Thank you in advance