我有以下代碼。我試圖使用我的瀏覽器訪問其他客戶端的鏈接,並且工作正常。我的問題是,當我嘗試訪問它在我的角度的應用程序它返回一個錯誤的錯誤請求,爲什麼?Angularjs 400(Bad Request)
我的Api是由laravel製成的。在auth /需要的access_token POST方法,和JSON頭,還它返回一個JSON值
$http.post(api + "auth/access_token",
{
username : username,
password : password,
grant_type : 'password',
client_id :'54321',
client_secret :'terces'
})
.then(function (result) {
userInfo = {
accessToken: result.data.access_token,
userName: result.data.userName
};
$window.sessionStorage["userInfo"] = JSON.stringify(userInfo);
deferred.resolve(userInfo);
}, function (error) {
deferred.reject(error);
});
**
**
您是否正在使用laravel創建表單,例如'@form(..'? – 2014-09-22 08:21:08