What are the main patterns and / or attributes that create a RESTful application?
Doing things RESTfully is actually tricky.
At the end of the day, great attributes:
1 - URIs represent resources, not actions 2 - HTTP verbs describe what action to take
those.:
GETing http://www.example.com/something/1 will return something identified 1 POSTing http://www.example.com/something/1 will update it PUTing http://www.example.com/something will create what something new
3 - Answers to questions like GET requests should document other places the client can go to.
If a client requests http://www.example.com/movies/1 (via GET), the response should contain elements that point the client to related things. For example http://www.examples.com/review/movie/1 (which can display movie reviews # 1
This is really rude - spend the day searching and reading. Then try to figure out who is really talking about REST and who is confusing it with the basic RPC stuff with simplified URLs.
source to share
For starters, a RESTful web service must not violate any of the following constraints (detailed in Roy Fielding's seminal dissertation ):
- client-server
- without citizenship
- cached
- single interface
- multilevel system
Of these, "consistent interface" is especially important.
source to share
-
Understanding the difference between PUT and POST , and understanding what idempotency means.
-
REST! = RPC. There seems to be a lot of resources on the internet (like this one ), which seems to believe that just because there are multiple representations about a resource then it settles down. Links like / API / User / GetUser don't settle down.
source to share
Hypermedia as an Application State Engine (HATEOAS). An interpretation of REST with an explicit understanding of this single limitation will make everything else in REST an order of magnitude easier to understand.
source to share