【发布时间】:2014-09-05 06:37:24
【问题描述】:
我熟悉RESTful api (CRUD) 和AngularJS 和Slim PHP 框架。我正在关注本教程:http://www.blog.iamaronbarbosa.com/building-a-basic-crud-application-using-angularjs-and-slim-php-framework-part-1/。而当应用程序试图GET数据(文件:angular-crud/slim/index.php),
function ListCtrl($scope, $http) {
$http.get('api/users').success(function(data) {
$scope.users = data;
});
}
我收到错误代码说明,
Status Code: HTTP/1.1 404 Not Found
获取数据的网址是:http://localhost/angular-crud/slim/api/users。
编辑
但是,如果我将 url 应用为 http://localhost/angular-crud/slim/api/index.php/users 它会很好地返回数据。必须包含index.php 吗?如果没有,是否有使用 url http://localhost/angular-crud/slim/api/users 检索数据的解决方法?
我对这个领域很陌生,如果问题含糊不清,我深表歉意。我尝试检查端口并使用RESTClient 运行测试,但最终空手而归。非常感谢您对此事的专家建议:)
【问题讨论】:
标签: angularjs rest get http-status-code-404 slim