How-To: Create a REST API

Comparing #14 with #15

Revision #15 was created by waterloomatt waterloomatt on Feb 22, 2012, 12:54:02 PM.

Changed Delete a post: index.php/api/posts (DELETE) to Delete a post: index.php/api/posts/123 (DELETE)

Content

[...]
* **View all posts:** _index.php/api/posts_ (HTTP method _GET_)
* **View a single posts:** _index.php/api/posts/123_ (also _GET_ )
* **Create a new post:** _index.php/api/posts_ (_POST_)
* **Update a post:** _index.php/api/posts/123_ (_PUT_)
* **Delete a post:** _index.php/api/posts
/123_ (_DELETE_)


In order to parse these URL's, set up the URL manager in _config/main.php_ like this:
[...]