Reputation: 49
So I have a few misunderstandings on the names STATE TRANSFER
in REPRESENTATIONAL STATE TRANSFER.
state transfer
means transferring representations of a resource which is there in a server at the current instance of time?Example: Consider a client requested the current share price of some X company
by hitting /XCompanyPrice
URI and at the current instance of time in the server the share price of the company x
is 2 USD, and that is called the current state of the resource
, and that resource state may change is what we can say? And that is what STATE means in the acronym REPRESENTATIONAL STATE TRANSFER
?
OR
STATE TRANSFER
in the acronym REPRESENTATIONAL STATE TRANSFER
means, when user click on links on a webpage
the state of the application changes from one page to another page because of information may change for let's say: /about
& let's say: /contact
page.OR
let's say by: /image
consider the format of that image is BLOB at DB
, but REST transfers the representation of that image in an understandable format to the client and that is nothing but STATE TRANSFER
in the acronym REPRESENTATIONAL STATE TRANSFER.
Which is correct one in terms of REPRESENTATIONAL STATE TRANSFER.
So, the names state transfer
in REPRESENTATIONAL STATE TRANSFER
is saying the state of the application changes by data
or Transferring representations of resource which is there in the server at the current time????
Please help.
Upvotes: 5
Views: 193
Reputation: 49072
The only definitive source of information on the meaning of "REST" is Roy Fielding's dissertation introducing and defining that term.
The most succinct answer to your question is probably in section 5.2.1.2:
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.... Depending on the message control data, a given representation may indicate the current state of the requested resource, the desired state for the requested resource, or the value of some other resource, such as a representation of the input data within a client's query form, or a representation of some error condition for a response.
In other words, a component (like a client or a server) operates on a resource by transferring a representation of its state to another component.
I don't entirely understand the various definitions and examples you mentioned, but I would say the last one is essentially correct. The second one seems incorrect since "state" here clearly refers to a specific resource and not a nebulous "application state".
Upvotes: 3