Different people seem to have different definitions of rest, some are very strict, and others are more liberal. I tend to think that the rest architecture exists in a continuous range,
As shown in the figure:
The basic idea behind rest is that we can think of the following:
· The simpler the better.
· The web has been a very successful one.
· The web is very simple.
· Web design is guided by a number of guiding principles that have been reliable for a long time in the past.
· Web services are designed to be web-style. Although different people have different definitions of rest, it is certain that there are characteristics that affect whether a service is restful, or it can not be considered a restful, or whether it falls somewhere in the contiguous range above. Some (not all) features are listed here:
· The rational use of the HTTP method (Get,put,post,delete is the primary HTTP method) tends to be strictly defined for the specific scenarios used by the--hi-rest.
For example, a hi-rest implementation uses the Get method to obtain, the Delete method is used to remove, the Put method is used to insert or update, and the Post method is used to append. The Lo-rest solution may use the Post method to insert, update, Delete, and attach operations.
· Selection of data representations--hi-rest solutions tend to choose standard data representations, while some lo-rest solutions think Pox is a good choice.
· The use of well constructed URIs--hi-rest solutions tend to use descriptive URIs and generally do not use query strings, and we can see the use of query strings in some lo-rest solutions.
· Other: The payload contains links to relevant information, using the appropriate HTTP response code. I didn't give a strict definition of what rest was, because I didn't think it mattered. The reason is that a specific definition does not matter from a WCF perspective. WCF supports the REST architectures (Hi-rest and Lo-rest) at both ends of the scope.
In fact, in the next article, I'll build a lo-rest implementation, and in the following article I'll demonstrate the implementation of the Hi-rest end. If none of this means anything to you, it doesn't matter, and the following article will provide a concrete example.