I am trying to replicate this curl using angular $http.get,
curl -H "Accept: application/json" http://localhost:3000/posts -H 'Authorization: Token token="1111"'
but I am not sure how to properly set the angular header
this is how I tried it,
app.controller('newsCtrl', function($http, $scope){
$scope.news =[];
$http.get('http://localhost:3000/posts.json', {
headers: {"Authorization": "Token[token]=1111"}).success(function(response){
console.log(response)
})
})
So how do I properly set the header?
Thank you ps: I am not using Basic authentication.