# What is 'Representational State Transfer'?

**URL:** <https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612>\
**Category:** Rails\
**Created:** [April 27, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612 "2009-04-27T21:55:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 27, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/1 "2009-04-27T21:55:23Z")

</div>

I have read about REST, but never really understood meaning of  
‘Representational State Transfer’. I tried to read Fielding’s  
dissertation, but did not understand this term and why has he used it.  
What does it mean? Which state? What transfer?

Thanks,  
Amita.

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 27, 2009, 11:17pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/2 "2009-04-27T23:17:20Z")

</div>

I for one found this post very useful.

On Mon, Apr 27, 2009 at 10:16 PM, Robert W. \<

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 27, 2009, 10:16pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/3 "2009-04-27T22:16:26Z")

</div>

Amita B. wrote:

> I have read about REST, but never really understood meaning of  
> ‘Representational State Transfer’. I tried to read Fielding’s  
> dissertation, but did not understand this term and why has he used it.  
> What does it mean? Which state? What transfer?

I’m not sure anyone knows why Fielding used this term. I suppose he had  
to call it something, so that’s what he chose.

However, I’ll try to explain it as I understand it:

Representational:  
The web consists of resources in the form of web pages that are  
represented using a Uniform Resource Identifier (URI). REST extends this  
definition to refer to other types of resources of an application (i.e.  
database tables). Which, can also be represented using a URI.  
[http://example.com/posts/1](http://example.com/posts/1) represents the first Post resource in the  
posts collection.

State:  
This is the current state of the resources.

Transfer (or more precisely State Transfer):  
The act of modifying the current state of the resources. Adding a new  
one, modifying an existing one, deleting an existing one, etc.

REST defines a convention of using HTTP to both represent and change the  
state of resources. That’s a close as I can come to defining  
“Representational State Transfer.”

Hope that helps.

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 28, 2009, 12:33am UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/4 "2009-04-28T00:33:30Z")

</div>

Hi –

Robert W. wrote:

> Representational:  
> The web consists of resources in the form of web pages that are  
> represented using a Uniform Resource Identifier (URI). REST extends this  
> definition to refer to other types of resources of an application (i.e.  
> database tables). Which, can also be represented using a URI.  
> [http://example.com/posts/1](http://example.com/posts/1) represents the first Post resource in the  
> posts collection.

A resource in the REST sense isn’t anything as concrete as a database  
table, though. It’s more conceptual. As Fielding says: “The resource is  
not the storage object. The resource is not a mechanism that the server  
uses to handle the storage object.”

> State:  
> This is the current state of the resources.
> 
> Transfer (or more precisely State Transfer):  
> The act of modifying the current state of the resources. Adding a new  
> one, modifying an existing one, deleting an existing one, etc.
> 
> REST defines a convention of using HTTP to both represent and change the  
> state of resources. That’s a close as I can come to defining  
> “Representational State Transfer.”

My nutshell take on it is something like this:

A given system gives and receives representations of resources. A  
resource is a very high-level construct; a representation is more  
specific, and has a content-type and so forth. Resources don’t. (Even  
more low-level are matters of storage, which may vary and which are not,  
themselves, either resources or representations.)

A resource is always in a given state. Resource states are altered via  
the exchange of representations. So if I want to correct the spelling of  
my name on a site, I submit a representation of my profile with the new  
spelling (probably in the form of a Web form). If I want to make sure  
it’s OK, I request a representation (probably in the form of an HTML  
document) to inspect.

I’ve written a bit more about this on these blog posts:

[http://dablog.rubypal.com/2008/3/23/splitting-hairs-over-resource](http://dablog.rubypal.com/2008/3/23/splitting-hairs-over-resource)  
[http://dablog.rubypal.com/2008/4/24/splitting-hairs-over-resource-part-2](http://dablog.rubypal.com/2008/4/24/splitting-hairs-over-resource-part-2)

specifically in a Rails context. (Wow, was that more than a year ago?)

David

–  
David A. Black / Ruby Power and Light, LLC  
Ruby/Rails consulting & training: [http://www.rubypal.com](http://www.rubypal.com)  
Now out in PDF: The Well-Grounded Rubyist ([The Well-Grounded Rubyist](http://manning.com/black2))  
“Ruby 1.9: What You Need To Know” Envycasts with David A. Black  
[http://www.envycasts.com](http://www.envycasts.com)

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 28, 2009, 6:44am UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/5 "2009-04-28T06:44:06Z")

</div>

David A. Black wrote:

> Hi –
> 
> Robert W. wrote:
> 
> > Representational:  
> > The web consists of resources in the form of web pages that are  
> > represented using a Uniform Resource Identifier (URI). REST extends this  
> > definition to refer to other types of resources of an application (i.e.  
> > database tables). Which, can also be represented using a URI.  
> > [http://example.com/posts/1](http://example.com/posts/1) represents the first Post resource in the  
> > posts collection.
> 
> A resource in the REST sense isn’t anything as concrete as a database  
> table, though. It’s more conceptual. As Fielding says: “The resource is  
> not the storage object. The resource is not a mechanism that the server  
> uses to handle the storage object.”

Absolutely. Thanks David for this elaboration.

> A given system gives and receives representations of resources. A  
> resource is a very high-level construct; a representation is more  
> specific, and has a content-type and so forth. Resources don’t. (Even  
> more low-level are matters of storage, which may vary and which are not,  
> themselves, either resources or representations.)
> 
> A resource is always in a given state. Resource states are altered via  
> the exchange of representations. So if I want to correct the spelling of  
> my name on a site, I submit a representation of my profile with the new  
> spelling (probably in the form of a Web form). If I want to make sure  
> it’s OK, I request a representation (probably in the form of an HTML  
> document) to inspect.

Nice explanation. I look forward to reading your articles when I have a  
few spare moments.

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 28, 2009, 10:04pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/6 "2009-04-28T22:04:42Z")

</div>

JDM wrote:

> “Representational State Transfer defines a convention for using HTTP  
> to both identify and manipulate related information that is  
> conceptually mapped into an aggrregate construct referred to as a  
> Resource.”

> Jim M.

Quite succinct. I like it.

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 28, 2009, 6:47pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/7 "2009-04-28T18:47:21Z")

</div>

David,

Your posts are certainly an interesting aside on the IMproper usage of  
the term “resource”, but it doesn’t (for me) answer the original  
question: “What is Representational State Transfer?”

Like Amita, I struggle with this. My hope is to someday have a  
succinct way of expressing the answer, without being forced to convey  
all of the detailed nuamce of Fielding’s dissertation (which I don’t  
really grasp in any great detail).

I kinda like where Robet was going, but I’ll suggest a slight  
rephrasing:

“Representational State Transfer defines a convention for using HTTP  
to both identify and manipulate related information that is  
conceptually mapped into an aggrregate construct referred to as a  
Resource.”

I repeat - I don’t really understand all of the detailed nuance. I’m  
struggling to create a simple articulation of the basic idea.

Is my articulation sorta, kinda, in a way, maybe correct? How can my  
articulation be improved?

Jim M.

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 29, 2009, 1:31am UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/8 "2009-04-29T01:31:38Z")

</div>

I guess I was trying to duck the issue, but I see that does nothiing  
to elucidate the use of the word “Representational” in the REST name.

I’ll suggest this change (though its getting quite wordy):

“Representational State Transfer defines a convention for using HTTP  
to both identify and manipulate related information that is  
conceptually mapped into an aggrregate construct referred to as a  
Resource, via the transfer between application components of  
Representations that contain the current or intended state of that  
Resource.”

Whadda ya think?

Jim M.

On Apr 28, 4:35 pm, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![amita0204](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@amita0204](https://www.ruby-forum.com/u/amita0204)\
**Post date:** [April 28, 2009, 11:35pm UTC](https://www.ruby-forum.com/t/what-is-representational-state-transfer/166612/9 "2009-04-28T23:35:15Z")

</div>

JDM wrote:

> I kinda like where Robet was going, but I’ll suggest a slight  
> rephrasing:
> 
> “Representational State Transfer defines a convention for using HTTP  
> to both identify and manipulate related information that is  
> conceptually mapped into an aggrregate construct referred to as a  
> Resource.”

Thanks for the vote of confidence. I certainly don’t claim to be an  
expert on the subject. There are a lot of people smarter on this stuff  
than I, which is why I tried to remain somewhat abstract. I do like your  
rewording of my original thought. It certainly seems like a good start.  
However, as David pointed out in his excellent blog postings, this  
definition may still be omitting one important aspect of REST, which is  
the distinction between a “resource” and a “representation” of a  
resource. I feel that I have a good mental grasp on this distinction,  
even if I’m not so great at applying the concepts to the written word.
