Friday, February 27, 2015

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.
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