A, REST (Representational State Transfer) Representational State Transfer (Representational state transition), presented in 2000, based on HTTP, URI, XML, JSON and other standards and protocols, to support lightweight, cross-platform, cross-language architecture design. Is a new architecture style Web services (an idea).
Second, the main principles of REST architecture
-
All resources on the network has a resource identifier.
-
The operation will not change the resource identifier.
-
There are many manifestations of the same resources (xml, json)
-
All operations are stateless (Stateless)
REST architecture a manner consistent with the above principles called RESTful
Three, RESTful request format or rules:
uri no verbs, nouns are used, no verbs, nouns presence of relatively complex number need to add s
http://127.0.0.1/user/1 GET query based on user id user data
http://127.0.0.1/user POST new user
http://127.0.0.1/user PUT modify user information
http: //127.0. 0.1 / user dELETE delete user information
Fourth, the agreement: with http or https
V. Example: