Best Practices for RestFul API's design

Richardson Maturity Model
1.Client- Server:- Client and server should be separated
(Ex:- Gmail where if gmail do updated we don't need to update our browser we can still use the same browser)
2. Stateless:- Each message should have all info that need to transfer.
3. Cacheable:- every message should indicate wheather it should be cache able locally or not.
4. Uniform interfaces:- decoupling the services that are providing.
5. Layered systems:- having multiple systems under same api.
6. code on demand (optionals):- shipping code with extra functionality which will be enable on need.

Uniform interfaces:- Four Principles
Level 0: POX(plain old XML)
1. Identification of resources
Level 1: Resources
2. Manipulations of resources through these representations
Level 2: HTTP Verbs
3. Self-descriptive messages:- it should be(1.How to process itself 2. if that resource is cacheable 3. how to request next resource)
Level 3: Hypermedia Controls
4. Hypermedia as the engine of application state(HATEOAS)


No comments:

Post a Comment