我熟悉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
),CRUD与AngularJS和Slim PHP 404未找到
function ListCtrl($scope, $http) {
$http.get('api/users').success(function(data) {
$scope.users = data;
});
}
我得到的错误代码,说明, Status Code: HTTP/1.1 404 Not Found
的URL得到的数据是:http://localhost/angular-crud/slim/api/users
。
编辑
但是,如果我申请了网址为http://localhost/angular-crud/slim/api/index.php/users
它返回的数据的罚款。是否必须包括index.php
?如果没有,是否有解决方法检索使用url http://localhost/angular-crud/slim/api/users
的数据?
我对这个领域很新,如果问题很模糊,我很抱歉。我试着检查端口,并使用RESTClient
运行测试,但最终空手。您对此问题的专家建议非常感谢:)
谢谢您的主席先生的答案。这是一个重写问题:) – 2014-09-05 17:27:18