4. ReST - History
● Representational State Transfer
● ReST was re-DISCOVER-ed by Roy Fielding
● Doesnt require any external library
● Tightly bond with HTTP
10. ReST - Quotes
“Web it's not about HTML pages, it's about resources,
and those resources are located by URLs”
11. So ?
● We only need two base URLs as the location of a resource
(collection of resource, and single resource)
● Resources is Noun, use Noun :)
● Plural is better
Resource POST GET (READ) PUT DELETE
(CREATE) (UPDATE)
/users Create new List all Users Update All Delete All
user Users Users
/users/1 - Show User Update User Delete User
(with ID = 1) with ID = 1 (if with ID = 1
Exist)
12. Association ?
Easy :)
GET /departments/1/users
POST /departments/1/users
PUT /users/123
DELETE /users/123
13. Query
Use '?' for Query
GET /users?limit=50&offset=100
GET /users?username=indra&birth=1990
GET /users?column=id,name,username,birth
GET /users.json (/users.xml)