URL is an URI which identifies a resource by location.
Resource representation is a view of resource’s state. This view is encoded in one or more transferable formats, such as XHTML, Atom, XML, MP3 …
URIs associate resource representations with their resources
a) So I assume URI identifies a resource and not resource representation?
b) I’ve read that relationship between an URI and resource representation is one to many. Assuming we’re talking about URL, how can a single URL address more than one resource representation?
thank you
With content negotiation. http://en.wikipedia.org/wiki/Content_negotiation
When you dereference your URI using HTTP, you pass an “Accepts” header with the different mime types you’re willing to take. For example, you might be able to read JSON, XML or plain text: “application/json application/xml text/plain”. Whatever resource you’re reading (or writing) might come back as a representation in any of those formats.
In practice, most applications deal with one representation. Usually it’s just HTML, JSON, or XML. Sometimes a framework can render data resource with either JSON or XML, based on the Accepts header. But since we usually write code for one representation, or else the parsing is hidden by our framework, it kind of feels like the resource just has one representation. But that’s just a perception.
6