The content of this article is summarized and excerpted from MSDN, and reni and wanfa natural articles about REST in the garden.
MSDN:
Besides SOAP there is an alternative for the realization of Web services. in his dissertation Thomas Roy Fielding describes an unsupported tural style he calles REpresentational State Transfer architecture, briefly REST. REST is based on principles, which are used in the largest distributed application-the World Wide Web. without intention there are using search engines, shops or booking systems that are already available as REST based Web services. the REpresentational State Transfer architecture is an architecture that describes how the Web shocould work. REST is neither a product nor a standard.
REST defines an unsupported tural style based on a set of constraints for building things the "Web" way. REST is not tied to any participant technology or platform-it's simply a way to design things to work like the Web. people often refer to services that follow this philosophy as "RESTful services."
The GET method allows you to retrieve a resource representation, while PUT allows you to create or update a resource with the supplied representation, and DELETE allows youto delete a resource. in short, GET, PUT, and DELETE provide basic CRUD operations (create, retrieve, update, and delete) for the Web. HEAD and OPTIONS, on the other hand, provide the ability to retrieve resource metadata, allowing you to discover out how to interact with resources at run time.
Although HTTP fully supports CRUD, HTML 4 only supports issuing GET and POST requests through its varous elements. this limitation has held Web applications back frommaking full use of HTTP, and to work around it, most applications overload POST to take care of everything but resource retrieval. HTML 5, which is currently under development, plans to fix this by adding new support for PUT and DELETE.
Overall description:
Representational State Transfer (REST) is not a standard, but a software architecture style. Compared with SOAP-based services, REST-based services have higher performance, efficiency, and ease of use, while the SOAP protocol is complex and opaque. REST is welcomed by more and more Web service providers. Currently, most vendors, such as yahoo, google, and Amazon, provide restful services.
The main principles of REST are:
1. Everything on the network can be abstracted as resources;
2. Each resource has a unique resource identifier URI;
3. Use standard methods to operate resources;
4. All operations are stateless;
5. Improve performance through caching.
REST is based on Http, and any operations on resources are implemented through Http. Http limits the operation on a resource to four methods: GET, POST, PUT, and DELETE. This is the implementation of resource CRUD operations. The REST resource can be expressed in XML, HTML, JSON, or any other format, depending on the service provider and the user who consumes the service.
But REST is not omnipotent. Stateless operations also pose a huge security issue. How do I authorize and verify users? How can I avoid Information Leakage If I require that each request contain complete identity and authentication information? Complex Functions challenge the ease of use of the architecture, which requires a trade-off between performance and functionality, whether to use REST or SOAP.
Although REST contains the statelessness concept, it does not mean that applications that expose functions cannot be stateful. In fact, in most cases this will make the entire practice useless. The REST status is either put into the resource status or saved on the client. In other words, the server cannot maintain the communication status of any client other than a single request. The most direct reason for doing so is scalability.