Home  >  Article  >  How to understand restful

How to understand restful

anonymity
anonymityOriginal
2019-05-07 14:20:338749browse

Restful is representational state transfer. It is a network-based software architecture design. RESTful can be understood through its architectural core and four constraints.

How to understand restful

REST’s full name is Representational State Transfer, which in Chinese means representational (Editor’s note: usually translated as representation) state transfer. It first appeared in 2000 in the doctoral thesis of Roy Fielding, one of the primary writers of the HTTP specification. He mentioned in the paper: "The purpose of writing this article is to understand and evaluate the architectural design of network-based application software on the premise of complying with the architectural principles, and to obtain an architecture with strong functions, good performance, and suitable for communication. "Architecture. REST refers to a set of architectural constraints and principles." If an architecture conforms to the constraints and principles of REST, we call it a RESTful architecture.

REST itself does not create new technologies, components or services, but the idea behind RESTful is to use the existing features and capabilities of the Web and make better use of some guidelines and constraints in existing Web standards. . Although REST itself is deeply influenced by Web technology, theoretically the REST architectural style is not bound to HTTP, but currently HTTP is the only instance related to REST. So the REST we describe here is also REST implemented through HTTP.

Core specifications and constraints of RESTful architecture: Unified interface

is divided into four sub-constraints:

1. Each Resources have a resource identifier, and the resource identifier of each resource can be used to uniquely identify the resource

2. Self-descriptiveness of the message

3. Self-descriptiveness of the resource.

4.HATEOAS Hypermedia As The Engine Of Application State(Hypermedia As The Engine Of Application State)

That is, the client can only get the next step through the information contained in each result returned by the server. Information required for the operation, such as which URL to send the request to, etc. In other words, a typical REST service does not require additional documents to indicate which URLs are used to access specific types of resources, but uses the response returned by the server to indicate what operations can be performed on the resource.

The above is the detailed content of How to understand restful. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn