- PHP 的file() 或file_get_contents()方式
Part 1 – Creating a RESTful API
Step 1: Setting up the Demo
Firstly you need to download the codeigniter-restserver code from GitHub and extract it and move the code to your server.
When you open the folder, you will see an entire CodeIgniter install, which is there to power the demo. This allows people to have a play with the REST demo before integrating with your existing application.
Open up “application/config/config.php” and set the base_url to get links working. This base_url will be different for everyone and depends entirely on where you uploaded your files.
Step 2: The URLs
With the files extracted and the base_url set, we are ready to load up our RESTful CodeIgniter installation, and have a look at the demo supplied with it. Browse the base URL, which by default is: 继续阅读“Working with RESTful Services in CodeIgniter”