Suppose I have a weblog application with RESTful resources accessible at the following URLs: GET /posts GET /posts/1 GET /categories/ GET /categories/1 GET /categories/1/posts As implemented the semantics of /posts and /categories/1/posts are such that they show "current" posts, with current defined to be a rolling window of a certain duration. My question is this: what do you think is the best way to represent the archives of older posts as RESTful resources? We could do this: GET /posts/archives GET /categories/1/posts/archives or this: GET /archives/posts GET /archives/categories/1/posts or this: GET /archived_posts/ GET /categories/1/archived_posts or, undoubtedly, others. What do you think is the most defensible approach? Note: if you don''t like the idea of having GET /posts return only "current" posts then you can perfectly well invert my question. Let GET /posts retrieve the full set of all posts known to the system. What then is a good RESTful representation that limits results to "current" posts? Thanks in advance for your thoughts, Sven --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeffrey L. Taylor
2009-Jan-13 21:37 UTC
Re: Theory/opinion question: What are good RESTful archive URLs?
Quoting Sven <Sven.Aas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Suppose I have a weblog application with RESTful resources accessible > at the following URLs: > > GET /posts > GET /posts/1 > GET /categories/ > GET /categories/1 > GET /categories/1/posts > > As implemented the semantics of /posts and /categories/1/posts are > such that they show "current" posts, with current defined to be a > rolling window of a certain duration. >GET /posts/1.html # "current" posts GET /posts/1.xml # all posts The former is presumably a browser with a human in front of it. The latter is another app that can define "current" for itself it it wants. Same applies to other non-human readable formats, e.g., json. Just my $0.02USD, Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---