1. What is rest?
REST was a term put forward by Roy Fielding in his paper the architectural Styles and the design of network-based Software architectures.
REST is an abbreviation of the English representational state Transfer, which has Chinese translations for "representational status Transfer" (Reference: Representational states Transfer (REST) and data distribution in the SIP/IMS network 》 )。
Rest can be summed up as follows:
1.1 First rest is just a style, not a standard
You won't be the putting out a REST specification. You are not, IBM or Microsoft or Sun selling a REST developer ' s toolkit. Why? Because REST is just a architectural style. Can ' t bottle up that style. You can only understand it, and design your WEB services in that style.
-Roger L. Costello "Building Web Services" REST Way.
1.2 Rest is resource-centric
In rest, the web is considered to consist of a series of abstract resources (abstract Resource) that have different concrete representations (representational state). For example, defining a resource as photo, meaning a photograph, can be a picture or an. xml file that contains some elements that describe the photo. or an HTML file. And these concrete manifestations can be distributed in different physical locations.
The purpose of 1.3 rest is to decide how to make a well-defined web program move forward
A program can make a program run further by selecting a hyperlink on a Web page (which represents a resource) that enables another Web page (representational state of the abstract resource) to be returned (transfer) to the user.
1.4 Rest make full use of, or extreme reliance on, HTTP protocols
It locates resources through logical URIs
In the definition of REST, a WEB application always renders (or exposes) a resource to the outside world using a fixed URI.
It must be noted here
1, a URI corresponds to a resource.
2, the URI here is a logical URI,
A logical Uri:http://www.example.com/photo/logo
A physical uri:http://www.example.com/photo/logo.html
Data that distinguishes a client from the form in which it is intended to obtain resources by identifying the HTTP Request Header information.