title: 401 Unauthorized error with $http and hedear param in in angularjs
body: <p>I am trying to a $http request with passing header params for login page, but its return 401 Unauthorized error. I have no idea any wrong code done.</p>
  
  <pre><code>var app = angular.module('myApp', [])
    .controller('myCtrl', ['$scope', '$http', function($scope, $http){
  
      var params = {"Username":"test", "Password":"test"};
  
      $http.post('http://192.168.6.168:9090/EOZAPI/api/1.0/secure/login/', {headers: params
      }).success( function (data, status, headers, config) {
        console.log(headers());
      })
      .error( function (data, status, headers, config) {
          console.log(headers());
      });
  
    }]);
  </code></pre>