RESTful interface design principles and advantages

RESTful architecture advantages:

Separate front and rear ends, to reduce traffic
safety issues focused on the interface, by accepting json format prevents injection type security issues
distal independent of, the rear end only responsible for data processing, the front end of the front end may be any expression language (android, ios, html5 )
front-end and back-end staff are more focused on their development, just interface documentation can be completed before and after the end of the interaction, without much mutual understanding and
server performance optimization: because the front end is a static page, you can get by nginx, pressure on the main server interface
a, RestFul Introduction
  REST (Representational state transfer is usually translated as "representational state transfer" or "Representational state transfer") is a descriptive term interconnect system architecture style RoyFielding raised. Why is it called REST? Web essentially composed by a variety of resources, resources from the URI uniquely identified. Browser (or any other browser-like application) will exhibit an expression of the resource, or a manifestation of state. If the user is directed to point to other resources links on this page, it will access the resource, and to show its status. This means that client applications with different performance status of each resource and the state transition occurs, also known as REST, java framework resources www.1b23.com.

  Simply speaking it is a REST URL to use to locate the resource using HTTP request describing the operation of Web services specifications. REST includes the following aspects:

  (1) REST is a set of architectural principles and constraints, and applications to meet these constraints and principles is RESTful. 
  (2) REST goal is to build scalable Web Service, it is a simpler alternative to SOAP (Simple Object Access Protocol) protocol as well as a WSDL-based WebService. 
  (3) REST used by the HTTP protocol and the HTTP GET, POST, PUT, DELETE verb send and receive data and the like. 
  (4) REST desirable to complete meta data operation through HTTP, i.e. conventional CRUD (Create, Read, Update, Delete) corresponding GET, POST, PUT, DELETE, thus unified interface data operations implemented in different provide a set of services on the same platform. 
  (5) REST is a service-oriented, distributed API design.

  RESTful API developed and used, is that the requesting client to the server (Request), and the server responds to the client request (response). So RESTful architectural style features a unified interface, namely: the use of different methods to express different behaviors http:

GET (SELECT): out of the server resources (one or more)
POST (the CREATE): a new resource on the server
PUT (UPDATE): In the server updates the resource (client provides full resource data)
PATCH (UPDATE): server update resources (provided by the client need to modify the resource data)
dELETE (dELETE): delete the resource from the server


Guess you like

Origin blog.51cto.com/14622073/2462071