Re: trailing slash for collection URIs?
Nicholas Shanks <[email protected]> Tue, 29 Oct 2013 10:53:42 +0000
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CA+hEJVWkYs1ious-B9cdSKpWNmxnsAZS7OS26_KF=KAJ-+A7Tw@mail.gmail.com> |
As others have said, it's really a matter of personal preference. 1) I think /contacts?city=London looks nicer than /contacts/?city=London 2) It's easier (as you cite) to use relative URLs 3) You shouldn't be doing that anyway. Design your system so that it always spits out absolute URLs and you'll not have this issue (gzip will compress the differences away). Just 'cos a URL has a slash doesn't make it not a resource! On 25 October 2013 07:56, Thomas Koch <[email protected]> wrote: > ** > > > Hi, > > this might be a hard to decide question like spaces vs. tabs: I might have > an > addressbook web application that has mainly two sites > > /myapp/contacts (or /myapp/contacts/ ?) > /myapp/contacts/{id} > > Should the /myapp/contacts URI have a trailing slash or not? > > From an implementation perspective I like the trailing slash so that I can > just use the contact id as a relative URI from the collection resource. > But on > the other site a collection might also be a resource? > > Thank you for any recommendation! > > Best regards, Thomas Koch > > > -- > Nicholas. >