Resources, Representations and Identifiers
A resource is a conceptual object identified by a URI. A representation is a transferable representation of that resource at a particular point in time.
For example, /users/42 can identify a user resource. Its JSON representation may contain id, name, and email.
The URI identifies the resource; JSON is merely one representation. The same conceptual resource could theoretically be represented as JSON, XML, HTML, or another media type.
Avoid exposing implementation details such as /getUserFromMongoCollection. Prefer resource-oriented identifiers such as /users/42.
Resource and Representation
Key Takeaways
- URI identifies a resource.
- A representation is a transferable view of that resource.
- The representation format is not the resource itself.