REST architecture

Representational State Transfer (REST) is an architectural style that defines a set of good practices, standards, and properties that can be implemented on top of the HyperText Transfer Protocol (HTTP). A web service that conforms to REST standards enables easy interoperability between devices on the internet.

RESTful web services enable client devices to produce and consume web resources, which are represented by using text with a uniform and predefined set of stateless operations. Web resources were defined by Tim Berners-Lee to be part of the World Wide Web (WWW) as resources/documents identified by a Uniform Resource Locator (URL). The flow of a RESTful web service can be defined as follows:

The preceding diagram shows a Client accessing a REST Resource over the internet. The Client initiates the communication by accessing the REST Resource identified by a Uniform Resource Identifier (URI). The HTTP Request can have different request methods based on what operation needs to be performed on the REST Resource. If it is just a read operation, then most of the time, the HTTP Request method GET is used. If any manipulation needs to be done on the REST Resource, then the appropriate HTTP Request method of either POST, PUT, or DELETE is used. Roy Fielding is considered the father of REST, as he was the first person to define the term in his PhD dissertation in 2000. 

The following architectural constraints are a part of REST:

  • Client-server model
  • Statelessness
  • Cacheability 
  • Layerability
  • Uniform interface 

In this chapter, Spring WebFlux will be used to implement REST controllers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.242.175