我正在创建一个带有Ionic框架和rest api的应用程序,但由于标题我得到了404,如果你有任何解决方案,我会在下面给你一些代码。
提前致谢。
$http.get({
url: url,
headers: {
Accept: 'application/json',
Context: 'instance='+instance+';token='+token+';user='+userId
}
})
.success(function(reponse){
console.log(response);
//$scope.id = data.id;
$scope.firstName = reponse.user.firstName;
$scope.lastName = reponse.user.lastName;
$scope.profession = reponse.user.mission;
userId = reponse.user.id;
localStorage.setItem("userId", JSON.stringify(userId));
$location.path('app/home/');
}).error(function(reponse, status){
console.log(reponse + "-" + status);
alert(status);
});