On REST’s Uniform Interface

Jim Webber suggests that a single verb is a sufficent “uniform interface”, and wonders why more are necessary. Mark Baker responds that POST is what Jim is describing, but makes a good case for including GET. And to Mark’s comment

That’s really good to hear you say that Web services have uniform semantics. But it’s impossible for them to be more uniform than REST, because REST prescribes uniform interface semantics by definition. - Mark Baker

Bill de hÓra replies:

I have to admit I don’t get this. What does it mean? - Bill de hÓra

I can’t speak for Mark, but in my mind uniform is a binary decision: either the architectural style prescribes uniform interface semantics or it doesn’t. Being uniform doesn’t imply that a resource supports the smallest interface possible; rather, it implies that every resource shares the same interface, irrespective of the interface’s size.

Neither Web Services nor HTTP limit the interface. HTTP, however, defines a common resource interface, whereas Web Services do not. I think this is a key point: I cannot rely on a Web Service to implement processThis or any other verb. In order to make such a guarantee, a spec must define the minimally-acceptable interface. Then conformant services/resources can be addressed uniformly.

I always find it helpful to make a distinction between the REST architectural style and HTTP (a protocol designed in that style). An architecture can be designed in the REST style without resorting to HTTP, and the result should exhibit the same properties as the Web does today. That’s the purpose of an architectural style–to achieve a resulting architecture that has certain properties.

I find it interesting that the “official” description of uniform interface in REST doesn’t mention verbs. Rather, uniform interface is “defined by” the familiar REST interface constraints:

  • identification of resources
  • manipulation of resources through representations
  • self-descriptive messages
  • hypermedia as the engine of application state

Where do verbs fit into these constraints? And is there anyone who understands Web Services that is willing to speak to the “identification of resources” constraint? That constraint in particular seems missing in Web Services.

Comments are closed.