What is representation in REST?

What is representation in REST?

In REST-speak, a client and server exchange representations of a resource, which reflect its current state or its desired state. REST, or Representational state transfer, is a way for two machines to transfer the state of a resource via representations.

What is a resource in a REST service?

“The key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a temporal service (e.g. “today’s weather in Los Angeles”), a collection of other resources, a non-virtual object (e.g. a person), and so on.

What is the way to represent the resource in REST?

REST uses various representations to represent a resource where Text, JSON, XML. The most popular representations of resources are XML and JSON.

Can a resource have multiple representations?

Resources can have multiple representations that use different formats such as XML and JSON. You can use HTTP headers and parameters to pass extra information that is relevant to the request and response.

How many representations can you make available for a resource?

Each resource can have one or more representations and at most one representation of each media type.

How is a representation used in a rest component?

REST components perform actions on a resource by using a representation to capture the current or intended state of that resource and transferring that representation between components. A representation is a sequence of bytes, plus representation metadata to describe those bytes.

What’s the difference between resource and resource representation?

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 a) So I assume URI identifies a resource and not resource representation?

What’s the difference between resource representation and URIs?

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.

What are the different RESTful representations of the same?

The query component contains non-hierarchical data that, along with data in the path component, serves to identify a resource within the scope of the URI’s scheme and naming authority (if any). So /foo?sections=a,b,d and /foo?sections=b are distinct identifiers.