Sunday, August 16, 2015

REST Services

REST is an architectural style of making web app/services uses http with its methods and apply certain principals on it to accomplish REST app/services.
REST stand for Representational State Transfer.

Rest service is useful when you required to access service in client script like Javascript, REST services can return data in Json format that can be used in scripting languages.

Principals used to implement RESTful services 
  1. Frame every thing like it is a resource
    Ex. User, Order
  2. Every resource should be represent with a unique url
    Ex. http://gstomar.blogspot.com/users/10
  3. Every request/response should be done with a representation
    Every call should present some view
  4. Interfaces should be simple & uniform
  5. Every request/response should be stateless
    Every request/response should be independent from each other

Methods used to accomplish RESTful services
S.No.
Method
Description
1
GET
Request a specific representation of a resource
2
PUT
Create or Update a resource with supplied representation
3
POST
Submits data to be processed by a resource
4
DELETE
Delete a resource
5
HEAD
Same like GET but accesses only header information
6
OPTIONS
Requests list of supported methods by resource

No comments:

Post a Comment

CI/CD - Safe DB Changes/Migrations

Safe DB Migrations means updating your database schema without breaking the running application and without downtime . In real systems (A...