I'm trying to use $resource to get datas from a REST web service.
here is my code :
return $resource('http://serverURL', {}, {
getQuartiers: {
method: 'GET',
headers: {
'Authorization': 'Basic base64login:pseudostring',
},
},
});
The problem is that with headers like this, it's an option request that is send and i get an error 401 Unauthorized. If i remove headers, it's a GET request. But i need headers to send my Authorization string !
Otherwise the webservice is ok, either by going with chrome directly to the url => popup with login/pwd => correct datas at json format or by using postman chrome extension, which send a GET request.
What's the matter ?