Building REST APIs code Igniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Building REST APIs code Igniter (/showthread.php?tid=61943) |
Building REST APIs code Igniter - rrpoduva - 06-02-2015 I am trying to develop REST APIs for my website. I am using CodeIgniter's PHP Framework. I have followed the tutorial mentioned on http://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter-2--net-8814 to create the restful apis. The tutorial is based upon the code developed on https://github.com/chriskacerguis/codeigniter-restserver I have placed the rest.php in application/config folder and REST_Controller.php in application/libraries/ I have created an api in application/controllers/example.php require APPPATH.'/libraries/REST_Controller.php'; Code: class example extends REST_Controller Code: RewriteEngine On However when I send a GET Request to mywebsite.com/example/user/id/1 it redirects to the homepage. Could someone guide me RE: Building REST APIs code Igniter - dbsolde - 06-02-2015 Hello, Did you edit your config file? the uri_protocol? just set it into 'AUTO'. RE: Building REST APIs code Igniter - ivantcholakov - 06-02-2015 array('hobbies' => array('fartings', 'bikes')) - for newer original versions of Format.php this array causes error if I remember correctly. I have the current https://github.com/chriskacerguis/codeigniter-restserver with modifications, it is downgraded for PHP < 5.4 with keeping BC as much as it is possible. Here is code from the tutorial that works - http://iridadesign.com/starter-public-edition-3/www/playground/rest/server Here you can find the modified libraries https://github.com/ivantcholakov/starter-public-edition-3/tree/master/platform/application/libraries |