views:

77

answers:

3

when i use GET to retrieve and show information only, and Create, Update, Delete using POST, will my web app be automatically RESTful?

+3  A: 

No, as the REST idea gives the following mappings:

GET - Retrieve
POST - Create
PUT - Update
DELETE - Destroy

2 of these html actions (PUT and DELETE) aren't normally supported by browsers so REST frameworks tend to use some fudging to allow them through browsers.

There's also a lot of design philosophy in creating a RESTful application, so it's not really possible to have something 'automatically' restful. There's a lot of discussion between some groups as to what REST actually entails as well.

workmad3
I wouldn't call a client-side (or Javascript) API "a bit of fudging". REST isn't designed for browsers, it's designed for proper client applications.
S.Lott
I was meaning things like the rails framework putting hidden fields into forms with the correct HTML action for a resource, and this getting processed transparently on the server to call the correct action... I'd call that a bit of fudging to get around REST in browsers.
workmad3
Sorry, but REST doesn't specify anything about HTTP. So I don't know where you got the idea that REST specifies these mappings. This is simply correct usage of HTTP.
Wahnfrieden
+3  A: 

It'll be closer, but not fully RESTful.

  1. You need, more than anything else, to ensure that all the necessary state is being transferred through the URI representation. (That's why it's "representational state transfer.")

  2. It's more common to use the other HTML methods for your operations.

Charlie Martin
A: 

No. REST has nothing to do with HTTP, it is protocol-independent. Using a protocol like HTTP correctly (except to get around places where its implementation is broken, like with the lack of PUT support etc) is necessary, but not sufficient to be RESTful.

Wahnfrieden