18570Re: [rest-discuss] Where should I POST to?
- Mar 1, 2012On Thu, Mar 1, 2012 at 7:45 AM, Ruben Verborgh <ruben.verborgh@...> wrote:
> Hi everyone,They're both valid. The first option is arguably a slightly better
> A hypothetical blog application:
> - /posts/43 identifies a blog post resource
> - /posts/43/comments/3 identifies a comment resource on this blog post
> Here are different ideas to create a comment:
> - POST on /posts/43
> According to the definition of POST , this should be acceptable under “annotation of existing resources”.
> - POST on /posts/43/comments
> According to the definition of POST , this should be acceptable under “posting a message […]”
> The question: which one(s) of the above seem acceptable, which one is “best”?
interaction as it's more visible because, as you say, the comments are
represented from this resource and so a successful POST would
automatically invalidate it in any participating caches. That's quite
useful because it allows you more generous Cache-Control max-age
values - it's particularly useful for gateway caching, specifically.
If your clients are driven by hypertext you can pick whichever one you
want.. if you found that you needed to switch from one to the other -
changing the URI would not disturb your clients.
- << Previous post in topic Next post in topic >>