Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With the RESTful approach, there is only one API, /Users, which is much easier to remember and document than four APIs. The HTTP methods are what define the behavior of the API. Since these methods are formally established in the HTTP protocol, they are not subject to redefinition, change, or republication with each set of RESTful APIs.

Another important constraint of the REST architecture, but often underutilized, is HATEOAS. This difficult to pronounce abbreviation stands for Hypermedia As The Engine Of Application State. A key feature of HATEOAS is that server responses include more than just content, they also contain the necessary hypermedia (i.e., URLs) necessary to move forward into the API. This is incredibly powerful because it allows APIs to be self-documenting. If clients are designed to anticipate URLs in the response then the server can change the URL to access a given resource at anytime, and this will not break the client or require new programming. To demonstrate:

 Request

GET /Users

Response

HTTP 1.1 200 OK
Content-Type: application/hal+json
Content-Length: ...
 

Two of the most notable features of RESTful web APIs are:

...