REST

Pages

Principles / constraints of REST

  1. An important principle for (RESTful) API design and usage is Postel’s Law, aka the Robustness Principle (RFC 1122): “Be liberal in what you accept, be conservative in what you send.”
  2. REST APIs must be hypertext-driven
  3. Resource-Oriented Architecture (ROA) Representational State Transfer, or REST
  4. SOAP, WSDL, and the WS-* stack = Big web services. Big Web Services don’t expose resources. The Web is based on URIs and links, but a typical Big Web Service exposes one URI and zero links.
  5. HATEOAS hypermedia-as-the-engine-of-application-state
  6. Client-Server
  7. Stateless Server: No side effects on the server when calls are made into it. No State Preserved between requests. Can’t lean on older ideas, like ASP.NET Session State, or even Application State. This would include authentication information on each call.
  8. Cache and ETags. There isn’t extra work being pushed onto the system for every request. No data store roundtrip unless necessary. Cache also implies that we’re going to use some mechanic to version the object that was retrieved from the server, not just the ID, but also the version of that.
  9. Uniform Interface. Broken down into: the Identification of Resources, the Representations that support modification, Self-Description, and HATEOAS.
  10. Layered System: client -> firewall -> gateway (proxy) -> load balancer -> multiple servers.
  11. Code On-Demand optional by Fleming, ability to deliver code to be run by client.

Books

Courses

  • Web API Design by Wildermuth
  • Implementing an API in ASP.NET Web API by Shawn Wildermuth