在尝试访问安全的Api时,我需要在我的角度http请求中发送标头数据
javascript代码:
$http.post('http://localhost/api/validate', user).success(function () { $scope.reset(); $scope.activePath = $location.path('/');
如何在此请求中发送标头数据?
//store the header data in a variable var headers = { 'Authorization': authToken }; //Add headers with in your request $http.post('http://localhost/api/validate',user, { headers: headers } ).success(function()