Restful Web Service
Explore the fundamentals of RESTful web services by understanding key principles such as resources, unique URIs, standard HTTP methods, multiple representations, and stateless interactions. Learn how these principles enable scalable web services and how Richardson’s Maturity Model categorizes RESTful service designs.
We'll cover the following...
What is REST
Rest Stands for Representational State Transfer
As part of his doctoral work, Roy Fielding generalized the web’s architectural principles and presented them as a framework of constraints, or an architectural style.
Fielding referred to this architectural style as Representational State Transfer or REST.
In simple terms, REST is nothing but an architectural style around the web. It encourages us to use the web with some constraints and guiding principles. Let’s look at the key principles around the HTTP and URI standards. Abiding by these rules and constraints will make our HTTP application a RESTful-service-enabled application:
- Everything is a resource.
- Each resource is identified by a unique identifier (URI).
- Use Standard HTTP Method.
- Resources can have multiple representations.
- Be stateless.
Let’s understand each principle one by one.
RESTful principle
Principle 1: Everything is a resource
Everything on the web should be treated as a resource.
A document, image, top trends on Twitter, today’s weather, stock prices, everything is a resource.