Reputation:
This is one of the interview questions asked recently. My answer was:
But he was not satisfied with the answer I gave. Can you please me let me know what are all the conditions that need to satisfy for a web service to call it a Restful web service.
Upvotes: 1
Views: 281
Reputation: 1138
Basically, the RestFul web service would follow the below principles, mentioning all of the below points should satisfy the interviewer.
Also, refer this link.
Upvotes: 0
Reputation: 209012
Most likely, the interviewer wants you get into the Richardson Maturity Model, where the last level of RESTfulness is adding hypermedia.
At level 0, you have a system that uses HTTP for remote interactions
At level 1, resources are introduced, where we are interacting with resources, as opposed to RPC-like interactions
At level 2, HTTP verbs are introduced, where we make use of semantics of GET, POST, etc requests. For example GET is idempotent.
At level 3, the final level where the service is RESTful, hypermedia controls are introduced. If you ever heard the acronym HATEOAS (Hypermedia as the Engine of Application State), this is basically what we are talking about here, adding hypermedia links to provide clients with information about accessible resources. The point of this is discoverability.
This is a very brief overview of the different levels. Read the paper to get into the details (a must read for any "REST" developer).
Upvotes: 1