What are the main patterns and / or attributes that create a RESTful application?

What are the main patterns and / or attributes that make a RESTful application?

+2


source to share


7 replies


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.

+2


source


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.

+1


source


Simple MVC commands are great.

Also you should make sure that you split your stuff into real model (for example, for a blog this would be a post / comments)

Also you have to use the whole HTTP verb like PUT / DELETE / POST / GET.

0


source


I think this may answer your question: Representational State Transfer

0


source


A fundamental consideration in REST is to keep a strict separation between "side effect free" methods and side effects.

0


source


  • 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.

0


source


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.

0


source







All Articles