REST Web Services

A REST (Representational State Transfer) Web service is a set of architectural principles by which you design Web services that focus on a system’s resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages.

REST Web services support these key principles:

Representational State Transfer – when called, a representation of the resource is returned, which places the client application in a state. Traversing the returned URL accesses another resource, placing the client application into yet another state. Thus, the client application changes (transfers) states with each resource representation.

REST establishes a one-to-one mapping between mobile business object (MBO) create, read, update, and delete (CRUD) operations and HTTP methods:
Example REST URIs include:
http://example.com/customers/1234
http://example.com/orders/2007/10/776654
http://example.com/products/4554
http://example.com/orders/2007/11
http://example.com/products?color=green 
and this XML code fragment which links the resources together:
<order self='http://example.com/customers/1234' > 
   <amount>23</amount> 
   <product ref='http://example.com/products/4554' /> 
   <customer ref='http://example.com/customers/1234' /> 
</order> 
With this representation, the standard HTTP GET method executes on the first resource:
http://example.com/customers/1234
Generic Interface Relationship
<interface>
Resource:
GET
PUT
POST
DELETE
/orders:
GET – list all orders
PUT – unused
POST – add a new order
DELETE – unused
/orders/{id}:
GET – get order details
PUT – update order
POST – add item
DELETE – cancel order
/customers:
GET – list all customers
PUT – unused
POST – add a new customers
DELETE – unused
/customers/{id}:
GET – get customer details
PUT – update customer
POST – unused
DELETE – delete customer
/customers/{id}/orders:
GET – get all orders for customer
PUT – unused
POST – add order
DELETE – cancel all customer orders