18574Re: [rest-discuss] Where should I POST to?
- Mar 2, 2012On 2012-03-01 07:45, Ruben Verborgh wrote:
> - People will never GET /posts/43/comments, because the comments will be served along with every representation of the /posts/43 resourceOne could choose to have a GET to /posts/43/comments 301 to
/posts/43#comments. Or to just add a GET that returns an entity of just
the comments, or simply say "well, if I made GET do anything it would be
to return an entity that shows just the comments, but since it'll never
be used I'm not going to bother implementing it".
The main reason I'd argue in favour of posting to /posts/43 is that the
relationship between /posts/43 and /posts/43 is obvious, while the
relationship between it and what is (relative to it) ./43/comments is
less so. Had the post had the URI /posts/43/ with a trailing slash, then
this would be less so pressing.
All of this is about niceties though. /adfs/d32rsdf/1ras89%20sfdakl
would be just as good as either from a purely REST perspective, but
niceties do matter.
- << Previous post in topic Next post in topic >>