Restful (Representational Status Transfer-declarative Status Transfer) architecture style. Currently, it mainly applies to the Internet (such as mobile clients ).
Hard to understand? Let's take a look at the link style:
Http://example.com/customers/1234
In this case, REST is a set of rules defining Web standards, such as HTTP and URIs.
REST key rules
1. Given any "resource" ID
2. Connect all resources
3. Use standard methods (Get, Post, Delete, Put)
4. Multiple Expressions of "Resources"
5. Stateless Communication
1. Given any "resource" ID
A resource is a term and is generally used as a set of key abstract features.
Here, we use URI (Unified Resource Identifier-Unified Resource Identifier) as the ID to identify resources. (URI consists of a global namespace -- http://example.com, and a global ID that can identify resources -- MERs/1234)
Therefore, we can use URI to identify a real resource (including ID ). Whether this resource is an expressive single resource (such as an object), a resource set, a virtual or physical object, or a computing result.
2. Connect all resources
Internet, you can use links to reference resources that actually exist. Hyperlinks can make the Internet more social and networked.
3. Use standard methods (Get, Post, Delete, Put)
Rest http Method application scenarios:
Class Resource {<br/> Resource (URI u); <br/> Response get (); <br/> Response post (Request r ); <br/> Response put (Request r); <br/> Response delete (); <br/>}
Example:
For example, to obtain a list of all customers for the customers resource, use Get; Add a new user and use Post; others are not used for the moment. The Get and Post operations on the resources customers are a kind of state transfer.
4. Multiple Expressions of "Resources"
Presentation of resource representations, which can be XML, TXT (plain text), and JSON format information. Therefore, you can provide different resource expressions as needed.
5. Stateless Communication
This stateless State may be a bit misleading. It refers to the stateless state of thinking. It does not mean that an object or a function is stateless, but that this stateless state is manifested in the resource state. Therefore, stateless communication isolates the dependency between the client and the server.
Make good use of these rules to beautify your Web style. The article is rough. Please advise!
Link: http://www.infoq.com/articles/rest-introduction