6360Re: [rest-discuss] Is it OK to have two URL's for GET's - one for a list of items and one for single items?
- Aug 1, 2006Hi Scott,
The same question came up a couple weeks ago -- you'll find several
different opinions. But all were agreed that REST itself doesn't
suggest one or the other approach, as long as client code is not
hard-coded with knowledge of any chosen structure. So it's just a
matter of human understanding. My own preference is for </sites/>
(including trailing slash) and </sites/2> (using the plural), treating
"sites" as a kind of virtual folder. The implementation approach I use
lets me differentiate those however I want, so they are separate
On 8/1/06, Scott Chapman <scott_list@...> wrote:
> I'm considering making different URL's for retrieval of a list of sites vs.
> one site (sites are actual locations on the ground in my scenario):
> List of sites: http://www.../sites?name1=value1&name2=value2
> Single site: http://www.../site/2
> Is this considered Ok for good REST development or should the "sites" (plural)
> URL be used in all cases?
> I am considering this because the implementation on the server side would be
> cleaner, having separate "pages" for list vs. single site returns. I'd like
> to know what people think of this.
> I'm new to RESTful design. Please let me know what the pro's and con's are of
> doing it this way from a design perspective.
- << Previous post in topic Next post in topic >>