tags:

views:

268

answers:

9
+1  Q: 

What is a REST API

Possible Duplicate:
What exactly is RESTful programming?

What is a REST API?

+6  A: 

Wikipedia is your friend.

João da Silva
Frankly, I usually vote down answers like this. I didn't this time, I went the other way. But now I feel a bit guilty about it. SO *is* a place for asking programming questions. Yes, searching for "REST API" throws up the Wikipedia article as the top hit, but... I guess it's a matter of where to draw the line. The Dalai Lama says "Be kind whenever possible. It's always possible." The bastard. ;-)
T.J. Crowder
One thing I've never understood about it, that wikipedia does not appear to cover, is how one could possibly make a RESTful application when it appears to require HTTP PUT and DELETE when no browser I know of supports these.
recursive
Agree, this is an easy question to answer by means of a Google search, but it is a programming related question so we should try to answer it. That's my opinion anyways.
Cesar
Hi TJ :) It's been a while since my last contribution on SO. I agree with you and with the Dalai Lama too ;) However I find SO useful for not-so-direct questions... a more typical question would be "if I do this in a servlet, is it still RESTful?". This particular questions shows that there was no previous effort in learning what "REST" is, thus the crude and direct answer. Anway, welcome to SO Lea!
João da Silva
@recursive: browsers aren't the only web clients. Think of using a RESTful API over HTTP instead of SOAP, for instance.
João da Silva
@ T.J. Crowder - apparently the Dalai Lama never uses SO.
Baddie
A: 

Wikipedia has a good description of REST

In particular, read the section on RESTful Web Services

Trevor
A: 

REpresentational State Transfer (REST) is an architectural style, defined by Dr. Roy Fielding's PhD thesis, Architectural Styles and the Design of Network-based Software Architectures. It is the architectural style used by the World Wide Web. An API is an application programming interface. A REST(ful) API is an API that follows the REST architectural style.

Hank Gay
+3  A: 

REST stands for REpresentational State Transfer. The Web is an example of a REST architectural style - HTTP GETs and POSTs are an example of RESTful commands.

More info: Wikipedia!

Ink-Jet
+1  A: 

Here's the wikipedia article

http://en.wikipedia.org/wiki/Representational_State_Transfer

Here is what I understand in simple language:

REST is an alternative to SOAP based web services. Where SOAP tries to model the exchange between client and server as calls to objects, REST tries to be faithful to the web domain. So when calling a web service written in SOAP, you may write

productService.GetProduct("1")

in REST, you may call a url with HTTP GET

http://someurl/products/product/1

I am not an authority on this subject by a long shot, so read more documentation :)

Tanmay
+1  A: 

REST is the model of the Web. For example, your browser makes a request to a URL and receives a response. That request can be a GET or POST (or a PUT, DELETE, or HEAD) and the response can be anything -- HTML, an image file, a PDF, XML.

The point is that anything, no just a browser, can make that sort of request and process the response. And thus, you have REST.

Neil
A: 

REST stands for Representational State Transfer, and it was proposed in a doctorate dissertation (see here). It uses the four HTTP methods GET, POST, PUT and DELETE to execute different operations. This in contrast to SOAP for example, which creates new arbitrary commands (verbs) like getAccounts() or applyDiscount()

A REST API is a set of operations that can be invoked by means of any the four verbs, using the actual URI as parameters for your operations. For example you may have a method to query all your accounts which can be called from /accounts/all/ this invokes a HTTP GET and the 'all' parameter tells your application that it shall return all accounts.

Cesar
+3  A: 

Stack Overflow is your friend. There is a tag called REST. If you go the questions with that tag and select the "Votes" tab you will see a plethora of general "What is REST/Getting started with REST". This type of question has been asked many times before.

Ironically, these general questions are often jumped on by people with little experience in the field because they are easy to throw in a vague answer, and they tend to get lots of visibility and up votes. Don't assume the first answers you get are right. You are better to review a question that was asked a while ago, has been well upvoted and was answered by someone with some credibility in that subject area.

Darrel Miller
Johann Gerell
+1  A: 

A 'REST API' is almost always just an 'HTTP API' given a different (wrong) name to make it sound better.

Mike
Oh, you're such a cynic ;-)
Darrel Miller