user6650906
user6650906

Reputation:

When do you say a web service is a complete RestFul web service?

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

Answers (2)

Koushik Ravulapelli
Koushik Ravulapelli

Reputation: 1138

Basically, the RestFul web service would follow the below principles, mentioning all of the below points should satisfy the interviewer.

  • Resource identification through URI
  • Uniform interface
  • Self-descriptive messages
  • Stateful interactions through hyperlinks

Also, refer this link.

Upvotes: 0

Paul Samsotha
Paul Samsotha

Reputation: 209012

Most likely, the interviewer wants you get into the Richardson Maturity Model, where the last level of RESTfulness is adding hypermedia.

model

Level 0

At level 0, you have a system that uses HTTP for remote interactions

Level 1

At level 1, resources are introduced, where we are interacting with resources, as opposed to RPC-like interactions

Level 2

At level 2, HTTP verbs are introduced, where we make use of semantics of GET, POST, etc requests. For example GET is idempotent.

Level 3

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).

READ ME: Richardson Maturity Model

Upvotes: 1

Related Questions