Rest Toolkit - User Defined Actions

This morning I got into work early (6:30am, which is early for me) and decided to add the ability to define special methods to rest-toolkit (original blog entry). “Special” in this case means adding the ability to call specific methods which allow special processing for a resource.

For example, making a rest request for news items might look something like this:

GET /news

This request should return all news items. On the other hand, the following would return all recent news items. Recent being defined in the recent method:

GET /news;recent

Those of you who are observant will notice that I have made use of the semi colon to separate the resource and the special method. Yeah, I have my Agile Web Development with Rails book open to page 415 right now. I stole your semi colon ;-). Rest toolkit also provides the ability to make requests which might also look like the following:

GET /news;recent.json
GET /news;recent.xml
PUT /news/1;lock

I invite you to take a closer look at the toolkit, and to provide me with feedback. I have used the application in production for an asp application, and have plans to use it in production for a Lasso application that needs to communication with punbb. I can’t guarantee that it is free of bugs (I should really write some tests for this thing), or that you won’t run into any hitches. If you do please be sure to let me know.

2 Comments for "Rest Toolkit - User Defined Actions"

Comment 1 Doug Thompson - Gravatar Doug Thompson

Hey Jason,

Congrats on the move from teaching. I'm still at it up in Ontario here and we're going through a lot of php.sql stuff right now. I'm trying to ditch the VB.6.0 to no avail.

I see you are using something called Cakephp? What is that? Could I use it for my students?

Thanks
Doug

Mon, 05 May 2008 12:06:00 +0000 Link

Comment 2 leveille - Gravatar leveille

Hey Doug,

Thanks. Yeah, I'd say it's time to move on from VB 6.0. I was lucky enough to be at a school that let me move on to .net w/ VS 2005 as soon as it was possible.

Everything you could possibly want to begin learning about CakePHP can be found at, or through, the cakephp.org website. In short, it is a PHP framework which takes care of a lot of the more mundane (and some of the not so mundane) tasks associated with creating any web application. This in turn allows you to create the application more rapidly.

I would say yes, it would be something you could use to teach PHP/Database with, though perhaps after teaching a quarter of the year on topics in PHP and a quarter of the year on topics in Database. I would recommend that you only use it for a class of students who have already had a basic web design course, and who have had at least 1 year of programming.

Mon, 05 May 2008 12:28:58 +0000 Link

Comments have been disabled for this post.