When building web services, one of the primary benefits of using REST over SOAP is the intuitive nature of service interfaces. However, this simplicity of interface can very easily be eroded. Below are some suggested (and hence flame proof) guidelines that could be followed to ensure continued interface simplicity:
Resource-Oriented
Addressable
Resource-Oriented
- REST is resource-oriented, not service-oriented. Resources are nouns, not verbs.
Addressable
- Every resource must be addressable by means of at least one URI (name). Names must be meaningful.
- Clients cannot access resources directly - they deal in representations of that resource (e.g, XML, JSON, ...)
- Resource representations would ideally be addressable (so that they can be passed around as URIs, eg. /rest/bookmarks.xml) The use of HTTP accept headers to specify representation is however acceptable, but should be provided as well as the addressable URI.