Answer the question
In order to leave comments, you need to log in
Angular $resource how to send your header?
In general, you need to send a request to the server indicating the Header in which I pass several parameters. It seems that I do everything as in the documentation, but the server returns an access denied. So I want to consult with someone who knows, maybe I made a mistake or sent the request incorrectly.
app.controller('groupListCtrl', function($scope, $resource){
$resource("http://server-adress", {}
,{
POST: {method: 'POST', cache: false, isArray: true, headers:{
'Content-Type': 'application/json',
'Authorization': 'Token token="set_user_token"'
}}
}).POST(
function succes(data){
console.log(data)
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question