To set the HTTP Header for a request using AngularJs you can use the following snippet.

$http({method: 'GET', url: 'www.fesslersoftexample.com/api', headers: {
    'Authorization': 'Basic YmVlcDpib29w'}
});

Use the headers parameter in the config object you pass to $http.

For more informations see the AngularJs API Reference

11 thought on “How to set the HTTP Header for a request using AngularJs”

Leave a Reply