RESTful search

I am working on a small project to build a web application using current best-practices and tools. To start, I am working on the RESTful interface -- the application's API. What I did not understand was how to do a RESTful search. Searching is not a GET because there is no one resource or all resources returned. It is not a POST because nothing is being updated. What I discovered looking around the web was that when using REST you are not limited to the gang-of-four HTTP methods -- GET, PUT, POST, and DELETE -- but instead are open to a whole other set of methods [a][b]. There is a SEARCH method at IETF in early draft state. This is good enough for my needs.

I will use Java for this project. I know how to implement the interface using the Servlet framework but I wanted to use a framework designed for RESTful interaction. I found the Restlet framework and really like what I see so far. (I have not coded anything yet and so don't know how practical it is.) There is also JSR 311, "JAX-RS: The Java API for RESTful Web Services", which is an annotation-oriented design. I like the Restlet's class-oriented design much better.

No comments: