13

Possible Duplicates:
SOAP or REST
Why do we need RESTful Web Services?

Hi folks,

lately, the REST web services is mentioned a lot. What is the reason for using it over other methods? Are they used in WCF & how do we implement one?

TIA

Community
  • 1
  • 1
SoftwareGeek
  • 13,780
  • 18
  • 57
  • 78

3 Answers3

9

REST is an oft misunderstood term. The precise definition can of course be found in Fielding's dissertation, and is attempted explained in the Wikipedia entry. In short it's an architectural style, and has nothing technically to do with HTTP or the web. HTTP and a lot of the web, however enable and follow the REST architectural style.

But in truth the term REST has been watered down and it now is almost synonymous with HTTP based API of some sort.

When developers talk about implementing or using a REST API they usually mean something along the lines of documenting URI templates for all their resources, and use GET to retrieve something, PUT to modify something, DELETE to delete something and POST to do anything else (like create or accept or modify something), like the Twitter API to update ones status or StackOverflow's own API or Facebook's API.

These APIs typically

  • give each interesting thing (resource) in their system their own URI
  • use the "uniform interface" (GET, PUT, POST, DELETE) on these URIs to work with the resources
  • use standard types of authentication schemes (like OAuth or OpenID or even simpler variants)
  • are stateless, in that each request is independent of any previous request

All these are good, and required of REST architectures, but alone aren't enough to follow the academic REST

I think this is a fitting description for REST as it is now. There are a few people who understand the difference between Corporate REST and Academic REST but their numbers are dwindling.

But that's the topic of another question, just search for HATEOAS.

mogsie
  • 3,637
  • 24
  • 25
  • 1
    I wish this answer was on one of the other "What is REST" questions, so we could close this one. Maybe some kind soul with lots of rep will merge them one day. – Darrel Miller Jul 09 '10 at 12:18
  • I looked for another "What is REST" question before posting it actually... But they were all "how to do this" or "is this better than soap". A concise "What is REST" is actually a good question. – mogsie Jul 09 '10 at 12:39
  • 1
    Yes it would be nice to have, but the problem with the generic "What is REST" types of questions is they tend to get lots of very shallow answers very quickly, and usually the most popular answer gets voted as correct even if it is a poor answer. Check out some of the questions with the highest votes in the REST tag and you will see what I mean. – Darrel Miller Jul 09 '10 at 13:54
  • Hmm. the question was closed. Should I move my answer somehow?? What does it mean? Will it be deleted? Hmmm... – mogsie Jul 09 '10 at 17:18
  • @mogsie - Yes, you are right, it is a good question. I searched SO before asking & found none similar, so i don't know what's the point in closing this question. Apparently some people have way too much time to try to close this question & they have done it. So, don't waste your time, they will not delete this post, just no more good answers. – SoftwareGeek Jul 11 '10 at 01:18
  • @Darrel Miller - yes, that happens a lot but if you don't just read the title and look at the actual question itself, you will see that it gets deeper. (no offense intended) – SoftwareGeek Jul 11 '10 at 01:22
  • @SoftwareGeek Asking three different vague and broad questions does not make it deeper. I can assure you that all of those questions have been covered time and time again on SO. – Darrel Miller Jul 11 '10 at 15:54
  • As I mentioned, I tried to find other SO questions on this but I couldn't find it. Until now: "what is rest" yields nothing interesting. "what exactly is rest" gives lots of nice questions. I eventually found http://stackoverflow.com/questions/671118/what-exactly-is-restful-programming but sadly the accepted answer is wrong, as @Darrel Miller pointed out would be the case. I wonder if SO is a reason we have so many pseudo REST (Corporate REST) APIs... – mogsie Jul 11 '10 at 22:51
  • @mogsie Nah, I don't think SO is the source of the problem, it just highlights how widespread the misconceptions are. – Darrel Miller Jul 12 '10 at 01:32
3

this tutorial will get you started http://www.xfront.com/REST-Web-Services.html

Aravind Yarram
  • 74,434
  • 44
  • 210
  • 298