Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $http.defaults.headers.common['Auth-Token'] = 'token';
- $http.defaults.headers.common['Authentication'] = 'authentication';
- myapp.factory('httpRequestInterceptor', function () {
- return {
- request: function (config) {
- // use this to destroying other existing headers
- config.headers = {'Authentication':'authentication'}
- // use this to prevent destroying other existing headers
- // config.headers['Authorization'] = 'authentication;
- return config;
- }
- };
- });
- myapp.config(function ($httpProvider) {
- $httpProvider.interceptors.push('httpRequestInterceptor');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement