Skip to content

Instantly share code, notes, and snippets.

@prasadyallapu
Created July 26, 2017 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasadyallapu/222eb8abef92b36b9adc10bbff901a69 to your computer and use it in GitHub Desktop.
Save prasadyallapu/222eb8abef92b36b9adc10bbff901a69 to your computer and use it in GitHub Desktop.

// 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); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment