Summary: Representational state Transfer (REST) is an architectural principle that treats a Web service as a resource that can be uniquely identified by its URL. A key feature of RESTful Web Services is the explicit use of HTTP methods to represent calls to different operations. Basic design principles for REST Use the HTTP protocol method for typical CRUD operations: POST-Create resource GET-Retrieve Resource put– update resource Delete-delete resource
Summary: A key feature of RESTful Web Services is the explicit use of HTTP methods to represent calls to different operations. Basic design principles for REST Use the HTTP protocol method for typical CRUD operations: POST-Create resource GET-Retrieve Resource put– update resource Delete-delete resource
1. Rest Introduction
Representational state Transfer (REST) is an architectural principle that treats a Web service as a resource that can be uniquely identified by its URL.
A key feature of RESTful Web Services is the explicit use of HTTP methods to represent calls to different operations.
The basic design principles of REST Use the HTTP protocol approach for typical CRUD operations:
POST-Create Resource
GET-Retrieving resources
put– Updating resources
Delete-Remove resource
The main advantages of REST services are:
They are highly reusable across platforms (Java,. NET, PHP, and so on) because they all rely on the basic HTTP protocol.
They use basic XML, rather than complex SOAP XML, and are very handy to use.
REST-based Web services are increasingly becoming the preferred approach for back-end enterprise service integration. Compared to SOAP-based Web services, its programming model is simple, and the use of native XML rather than soap reduces the complexity of the serialization and deserialization process and eliminates the need for other third-party libraries that function the same.
2. Purpose of preparation
The purpose of this paper is to modularize and service the functions of the system, and to provide the user's operation in a service way. According to the service specification between system and system, the interaction between system and system is transformed into customized service interaction to realize the integration between system and system.
3. Writing principles
Addressable (addressability)
Everything in REST is based on the concept of resources. Unlike an object or other noun in OOP, a resource is an abstraction that must be addressed or accessed through a URI.
Interface Consistency (Interface uniformity)
Unlike SOAP or other standards, REST requires that the method or verb used to manipulate the resource is not arbitrary. This means that developers of RESTful services can only use methods that are supported by HTTP, such as GET, PUT, POST, delete, and so on. Therefore, service description languages such as WSDL are not required
No status (statelessness)
To enhance scalability, the server side does not store the client's state information. This makes the server not tied to a particular client, and load balancing becomes much simpler. This also makes the server easier to monitor and more reliable
Figurative (representational)
The client is always interacting with some kind of resource, never directly interacting with the resource itself. There can also be multiple images of the same resource. Theoretically, any client that holds a resource's image should have enough information to manipulate the underlying resource.
Connectivity (connectedness)
Any REST-based system should anticipate that the client needs access to the relevant resources and should include those resources in the returned resource image. For example, you can include related steps in the sequence of actions for a particular RESTful service as a hyperlink so that the client can access them as needed.
4. Description of service use
1) Services already provided by the current system (please refer to the source of the relevant technology)
Jeesz RESTful Services Introduction