GET http:// localhost:8100 / [object%20Object] 404(Not Found)with ionic ans Rest Api

时间:2016-04-27 09:13:24

标签: rest http ionic-framework

我正在创建一个带有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);
});

0 个答案:

没有答案