6361RE: [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, 2006I think he was asking not only for a resource that is a collection, but also
the client providing an explicit list of data elements to return.
Although I haven't thought about it deeply, I would strongly recommend two
distinct URIs - one for the single data element and one for the collection
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of Justin T. Sampson
> Sent: Tuesday, August 01, 2006 2:31 PM
> To: firstname.lastname@example.org
> Subject: Re: [rest-discuss] Is it OK to have two URL's for
> GET's - one for a list of items and one for single items?
> Hi 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
> "pages" regardless.
> 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.
> > Thanks!
> > Scott
> Yahoo! Groups Links
- << Previous post in topic