.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.headers.common['X-Auth'] = apiKey;
}]);
The $httpProvider.defaults.headers object is probably where you are going to find your solution. The common object will set headers for all $http requests, though you can be more granular and set them for specific methods as well (GET, POST, etc.)
On Friday, July 6, 2012 6:59:34 PM UTC-7, Rameesh wrote:
How can I use the $resource service to call RESTful resources that requires Basic Authentication? How can I pass the user/password? Any links/posts/ideas are really appreciated.
A more general question: How I can define the Request Headers while using $resource?
Forgive the newbie questions. A couple of weeks and you'll find me answering similar questions myself :)
Rameesh