When designing resource hierarchies, when should one use sub-resources?
I used to believe that when a resource could not exist without another, it should be represented as its sub-resource. I recently ran across this counter-example:
A year later, I ended with the following compromise (for database rows that contain a unique identifier):
HTTP 307 ("Temporary redirect")pointing at the canonical URI. This will cause clients to repeat the operation against the canonical URI.
This approach has the following benefits: