I am trying to put an authorization header in my requests but it doesn\'t work.
I am using this:
var config = {headers: {
\'Authorization\': token
I was having this same issue and it turned out the issue had to do with Apache configuration on the server side. One thing I did find that might be useful to you here is that my Authorization token is sent in the preflight request headers rather than the main request, so it might not appear to be in the headers of the request when you look at it in the developer tools.
I'm setting my defaults like this:
app.config(function($httpProvider) {
$httpProvider.defaults.common['Authorization'] = token;
// For angular 1.5, use:
// $httpProvider.defaults.headers.common['Authorization'] = token;
});