// Using Http - Method1
$http({ method: 'GET',/ //url:"proxy"+"/"+"<Service-Url", -- Tried with adding proxy 'url':"", headers: { 'x-csrf-token': 'Fetch', "Content-Type" : "application/xml", "X-Requested-With": "XMLHttpRequest", "Accept": "application/atom+xml,application/atomsvc+xml,application/xml", "Content-Type": "application/atom+xml", "DataServiceVersion": "2.0", 'Authorization': 'Basic'+" "+ Base64.encode("username"+":"+"passwowrd")*/ } }).then(function(response){ $scope.token = response.headers('x-csrf-token'); });
// Using Ajax call - Method2
var settings = { "async": true, "crossDomain": true, "url": "", "method": "GET", 'headers':{ 'x-csrf-token': 'Fetch', 'Authorization': 'Basic'+" "+ encoded, } }
$.ajax(settings).done(function (response) { console.log(response); });