I have installed Restler on my local server to test and make some APIs for my project.
Api requests are handled via http://localhost/myproject/api/
.
Here is how you can debug and find whats wrong,
Remove the namespace in api.php. It is not required and will cause issues.
Copy explorer folder to /myproject/api
folder and add Resources class as an api class
$restler->addApiClass('Resources'); //this produces the needed resources.json
If you are adding User class with a namespace, make sure it defined under that namespace and made available with your include statements or autoloader.
You can create /myproject/api/cache
folder and make it writable. When you instantiate restler in production mode with cache refresh as shown below, it will create routes.php in cache folder which lists all the routes information
$restler = new Restler(true,true); //production_mode, refresh
Hope you find whats wrong with the above
Check to make sure your function is public
not private
.
I actually just had the same problem and just spent an hour figuring it out (facepalm).