angular/angular.js — pull request #7235 by grisendo (2014-04-24 17:31:47+00:00)
Title: feat(http): add data parameter to headers functions

This pull request adds to $http header functions a data parameter, so headers can use object properties to be built:

Example (in a $resource) :

...
login: {
url: './api/login.json',
method: 'POST',
headers : {
'Authorization': function(data) {
return 'Basic ' + btoa(data.user + ':' + data.pass);
}
},
...