I'm considering using Lucarast RESTler (http://luracast.com/products/restler/)
My PHP class has a method called 'solve' and it must accept an argument via POST
class Solver
{
function solve( $request_data )
{
...
}
If I simply name the method "solve", it can't be accessed via POST. I get 404.
POST http://localhost/path/to/my/method 404 (Not Found)
Apparently I have to name it "postSolve", that works. Or create another method called "postSolve" that simply calls "solve".
public function postSolve( $request_data )
{
return $this->solve( $request_data );
}
But I can't stop thinking there must be an elegant way of doing this.
How can I call my method whatever I want, and still make it accessible via POST?