Monday, June 17, 2013

What is REST?


REST (Representational State Transfer) has become popular these days because of the high need for integration what consequently makes it very important for every developer to know and understand. This article aims to give you a guidance in what rest is and how can you use it to improve your applications.

REST describes an architectural style of networked systems such as web applications. It was first introduced in 2000 in a Ph.D dissertation by Roy Fielding, one of the principal authors of the HTTP specification. REST refers to a collection of architecture constraints and principles, which some will be shown next.

Uniform Interface

The central feature that distinguishes the REST architectural style from other network based styles is its emphasis on a uniform interface between components. Components can be origin servers, gateways, proxies or user agents (browsers).

The term uniform interface is used to describe how a (small) number of verbs with well-defined and widely accepted semantics are sufficient to meet the requirements of most distributed applications. A collection of verbs is used for communication between systems. You can check the example below which uses these verbs.



REST is defined by four interface constraints: identification of resources, manipulation of resources through representations, self-descriptive messages, and, hypermedia as the engine of application state.

Identification of resources

The key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a collection of other resources or even a person. REST uses a URI (unique resource identifier) to identify the particular resource involved in a interaction between components, as you saw on the previous example where a order is identified by /order/{orderId}. 

Representations

REST components perform actions on a resource by using a representation to capture the current or intended state of that resource. Representations consists of data or metadata describing the data. The response should include both, representation metadata and resource metadata. This data format of a representation is known as media type. A resource can be provided in multiple media types and you can choose the one that best fits the application.

You could ask the server to give you a "order" with the media type application/json, for example, because your client is mobile so you need less data. Or maybe you have an external client that needs to read another format like XML, then he just have to ask the server for an application/xml and it will give you the data you want.

Stateless

This is an important principle of REST which requires that every interaction between components must be stateless. It means that every response must have all the information for that request to be fully understood. The right way of controlling state in REST is using HATEOAS. 

Hypermedia as the engine of application state (HATEOAS)

REST concentrates all the control state into the representations received in response to interactions. The goal is to improve server scalability by eliminating any need for the server to maintain an awareness of the client state beyond the current request. On the example below you can see that the order already gives you the link within payment for the next transaction step maintaining the transaction control on the client-side.


Self-descriptive messages

Another constraint of REST is that messages should be self-descriptive and with all information needed for the task to be completed.

Well, that’s it. Now you have a guidance in how REST works. We’ll continue to talk about it in further articles.

See you later!

Source:

Roy Thomas Fielding dissertation, 2000.
REST in Practice book, 2010.

50 comments:

  1. This technical post helps me to improve my skills set, thanks for this wonder article I expect your upcoming blog, so keep sharing...
    Regards,
    PHP Training in Chennai|JAVA Course in Chennai|Best JAVA Training in Chennai|JAVA Training

    ReplyDelete
  2. Hello Admin,
    Awesome Post! I like writing style, how you describing the topics throughout the post. I hope many web reader will keep reading your post at the end, Thanks for sharing your view.
    Regards,
    web design training chennai|Best web designing institute in chennai|Best web designing course in chennai

    ReplyDelete
  3. Quite a useful post, I learned some new points here. Thanks admin please keep posting updates regularly to enlighten our knowledge.
    PHP Training in Chennai | PHP Course in Chennai

    ReplyDelete
  4. Thank you for this valuable information. I have got some important suggestions from it. Get your business to the next level in simple steps.
    erp software solutions in chennai.

    ReplyDelete
  5. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it. erp software solutions in chennai.

    ReplyDelete
  6. Interesting post! This is really helpful for me. I like it! Thanks for sharing!

    Webseiten Gestaltung Lüdenscheid

    ReplyDelete
  7. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    https://www.besanttechnologies.com/training-courses/java-training

    ReplyDelete
  8. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging...
    PHP developers in chennai | PHP developers in India

    ReplyDelete
  9. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    java training in bangalore

    ReplyDelete
  10. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.


    java training in bangalore

    ReplyDelete
  11. Your new valuable key points imply much a person like me and extremely more to my office workers. With thanks; from every one of us.


    white label website builder

    mobile website builder

    ReplyDelete

  12. Thanks for sharing this niche useful informative post to our knowledge.
    brochure designers in chennai | brochure design company in chennai

    ReplyDelete
  13. Nice post... Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating...
    Best Summer Courses in Chennai|Best Summer Courses in Velachery

    ReplyDelete
  14. Your good knowledge and kindness in playing with all the pieces were
    very useful. I don’t know what I would have done if I had not
    encountered such a step like this.digital marketing training in chennai

    seo training in chennai

    ReplyDelete
  15. You are doing a great job. I would like to appreciate your work for good accuracy
    Regards,
    PHP Training in Chennai | PHP Course in Chennai

    ReplyDelete
  16. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...

    Best Graphics Designing Training Academy in Kanchipuram

    ReplyDelete
  17. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…

    Best Web Designing Training Academy in Kanchipuram

    ReplyDelete
  18. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...

    Best Java Training Academy in Kanchipuram

    ReplyDelete
  19. Thanks for sharing this niche useful informative post to our knowledge...
    Best java Training Academy in Kanchipuram

    ReplyDelete
  20. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me

    Best Cloud Computing Training Academy in Kanchipuram

    ReplyDelete
  21. This information is very useful and innovative..I gained more knowledge from this.Thanks for the nice information its very useful to read your blog...
    Best web designing Training Institute in in Kanchipuram

    ReplyDelete
  22. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site
    Best dotnet Training Institute in Kanchipuram

    ReplyDelete
  23. thank you for such a great article with us. hope it will be much useful for us. please keep on updating..
    Best software testing Training Institute in Kanchipuram

    ReplyDelete
  24. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us.
    Best dally erp 9 Training Institute in Kanchipuram

    ReplyDelete
  25. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Best web Designing Training Training Institute in Kanchipuram

    ReplyDelete
  26. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Best C++ Training Training Institute in Kanchipuram

    ReplyDelete
  27. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Best web designing Training Institute in Kanchipuram

    ReplyDelete
  28. Wonderful article.It is to define the concepts very well.Clearly explain the information.It has more valuable information for encourage me to achieve my career goal.
    Best JAVA and J2EE Training Institute in Kanchipuram

    ReplyDelete
  29. Wonderful blog… You provided very interesting information here. I feel happy to read this post. I hope that you will write many posts like this… Thanks for sharing and Keep updating…..No:1 Software Testing Training Academy in Kanchipuram

    ReplyDelete
  30. Wow!! What a interesting blog..Thanks The information which you provided is very much useful and easy to learn as well...keep rocking and updating... looking further..
    Best CCNA Training Institute in Kanchipuram

    ReplyDelete
  31. Nice post. I study something more challenging on completely different blogs everyday.
    Best JAVA and J2EE Course Training Institute in kanchipuram|

    ReplyDelete
  32. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Best Graphic Designing Course Training Institute in kanchipuram|

    ReplyDelete
  33. Hi, I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post.
    Best Python Course Training Institute in kanchipuram|

    ReplyDelete
  34. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    Best Advanced Amazon Web Services Course Training Institute in kanchipuram|

    ReplyDelete
  35. I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks
    Best Graphic Designing Course Training Institute in kanchipuram|

    ReplyDelete
  36. Excellent Blog very imperative good content, this blog is useful to beginners.
    Best Selenium Automation Course Training Institute in kanchipuram|

    ReplyDelete
  37. This blog is great.This information is very useful for me.Thanks for sharing your Ideas.Keep updating.Regards,
    Best Hardware and Networking Course Training Institute in kanchipuram|

    ReplyDelete
  38. I think this is an informative post and it is very useful and knowledgeable. I really enjoyed reading this post. thank you!
    Best Python Course Training Institute in kanchipuram|

    ReplyDelete
  39. Thank you so much for sharing. Keep updating your blog. It will very useful to the many users.
    Best Graphic Designing Course Training Institute in kanchipuram|

    ReplyDelete
  40. Nice blog.Your blog is really useful for me. Thanks for sharing this informative blog.
    Best Graphic Designing Course Training Institute in kanchipuram|

    ReplyDelete