tags:

views:

271

answers:

2

I have deployed a simple REST based application in RAD.

A simple URL is accessed using http://localhost/&lt;contextroot&gt;/users/&lt;username&gt; where <username> is accessed using reqeust.getAttributes(). Now, how do i pass more than one attribute to the REST service?

+3  A: 

Usually you'll use query parameters:

http://localhost/&lt;contextroot&gt;/users/&lt;username&gt;?a=10&amp;b=hello

You haven't indicated which language or framework you are using so I can't tell you how to do this in code.

Marcelo Cantos
Also, you can use the URI path, depending on what the parameters *mean*. If you need more than just query parameters, it should probably have been a POST request.
S.Lott
thanks for the quick response. I use Java / J2EE with RAD / Restlet framework. The purpose is to do a Search operation. Allow a "like" Search to be done. There is a need to pass "%" with query parameters.
Subramanian
@Subramanian: "There is a need to pass "%" with query parameters". So? You encode query parameters to escape special characters like that. Search for "Encoding Query Parameters" for examples.
S.Lott
A: 

You could also use URLs of the style http://localhost/&lt;contextroot&gt;/comments/&lt;username&gt;/after/&lt;date&gt;, but that tends to get messy if you wish to include a large number of options.

Christopher Creutzig