Friday, February 19, 2010

Understanding of Restful Architecture

RESTful interface means clean URLs, less code, CRUD interface.

CRUD means Create-READ-UPDATE-DESTROY.

You might heard about HTTP verbs, GET, POST. In REST, they add 2 new verbs, i.e, PUT, DELETE.

There are 7 default actions, those are – index, show, new, create, edit, update, destroy

GET is used when you retrieve data from database. POST is used when you create new record in database. PUT is used when you are updating any existing record in database, and DELETE is used when you are destroying any record in database. Following table may clear the concept.

Action VERB

index GET

show GET

new GET

create POST

edit GET

update PUT

destroy DELETE

No comments: