Skip to main content

How to set global header in HTTP request.

Here i will explain how to set global header in HTTP request angular js.
var app = angular.module('myApp', []);

app.run(function ($http) {
    $http.defaults.headers.common.Authorization = "Basic abc";
});

Comments