php - REST Service not working-Code Igniter -


i want implement phill sturgeon codeigniter restserver library in project.
copied files rest.php, format.php, rest_controler.php in folders config,library,library respectively.

i created controller called services following code:

<?php require(apppath.'/libraries/rest_controller.php');  class services extends rest_controller {        function teams_get(){          $teamnames=$this->team_model->getteamnames();           $this->response($teamnames);     } 

teammodel autoloaded in autoload.php. when want run teams_get method in browser result is:

{"status":false,"error":"unknown method."}

i read here should change rest_controler.php configuration file, change should done if post methods not working.

my services should public, don't need authentication methods.

what's wrong here?

when calling api, url should name of method, without _get (or _post). added rest server depending on how url called (get vs post).

so, call teams_get method, want send get request url /services/teams (not /services/teams_get).

docs: https://github.com/philsturgeon/codeigniter-restserver#handling-requests


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -