Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $http({
  2.     method: 'POST',
  3.     url: 'http://localhost:8080/DemoWebApplication/api/authenticate',
  4.     headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  5.     transformRequest: function(obj) {
  6.         var str = [];
  7.         for(var p in obj)
  8.         str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  9.        console.log(str.join("&"));
  10.         return str.join("&");
  11.     },
  12.     data: {user: 'selvyn', password: 'gradprog2016' }
  13. }).then(function(response) {
  14.       $scope.myWelcome = response.data;
  15.   });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement