Representational State Transfer
SOA - service-centric
ROA - resource-centric
Now who still wants to program procedurally?
SOAP is a layer on top of HTTP
HTTP is RESTful protocol
RESTful Web Services simply utilize HTTP
REST is not a protocol
SOAP can be used over other protocols (SMTP); application or transport layer. HTTP is an application protocol but used as transport protocol by SOAP.
What if the Web was built using XML-RPC, SOAP, or CORBA?
The HATEOAS principle basically means your application, as a Finite State Machine, should have all data necessary to change state contained in your response as hyperlinks.
Accept
Accept-Language
Accept-Encoding
Accept-Charset
Vary
HEAD
GET
POST
PUT
DELETE
OPTIONS
TRACE
CONNECT
Safe methods should NOT cause any side-effect on the server. Idempotent methods should be repeatable. Any safe method is idempotent but not vice-versa.
CRUD (POST
, GET
, PUT
, DELETE
)
Tunneling PUT
and DELETE
over POST
: use X-METHOD
or _method=
parameter
100 Continue
201 Created
(POST
/PUT
)202 Accepted
(POST
/PUT
)404 Not Found
410 Gone
204 No Content
(DELETE
requests; doesn't change document view)205 Reset Content
206 Partial Content
Accept-Ranges
416 Requested Range Not Satisfiable
301 Moved Permanently
302 Found
303 See Other
(no repost)304 Not Modified
(conditionals)305 Use Proxy
307 Temporary Redirect
Expires
Cache-Control
Last-Modified
If-Modified-Since
304 Not Modified
ETag
If-None-Match
304 Not Modified
GET
/store/products/GET
/store/products/{product_id}/POST
/store/products/ or PUT
/store/products/{product_id}/PUT
/store/products/{product_id}/DELETE
/store/products/{product_id}/POST
/users/ or PUT
/users/{user_id}/GET
/users/{user_id}/PUT
/users/{user_id}/POST
/users/{user_id}/cart/PUT
/users/{user_id}/cart/{product_id}/DELETE
/users/{user_id}/cart/{product_id}/POST
/store/orders/