試圖在angularJS下面的HTTP POST請求deployd,包含數據的用戶名和密碼,集合用戶,Angularjs HTTP POST呼叫deployd認證登錄失敗400錯誤返回
angular.module("sportsStoreAdmin")
.constant("authUrl", "http://localhost:2403/users/login")
.controller("authCtrl", ['$scope','$http','$location','authUrl', function($scope, $http, $location, authUrl) {
$scope.authenticate = function (user, pass) {
$http.post(authUrl, {
username: user,
password: pass
}, {
withCredentials: true
}).success(function (data) {
$location.path("/main");
}).error(function (error) {
$scope.authenticationError = error;
});
};
}]);
嘗試進行身份驗證登錄時使用上面的網址deployd,deployd給出以下錯誤: -
http://localhost:2403/users/login無法加載資源:服務器響應狀態爲400(錯誤請求)。
可能是什麼問題?
後的控制器處理請求的代碼,該方法需要的東西比你逝去的 – holtc
什麼Deployd產生它的API一種工具的不同...後端的控制器代碼不是我自己編寫的 –
添加屏幕截圖你面對什麼樣的錯誤 – Aravind