springmvc development restful API

  Non-url rest of writing:

Query GET / the User / Query? Name = tom 
details GET / the User / getinfo? The above mentioned id = 1 
Create a POST / the User / the Create? Name = tom 
modify POST / the User / Update? The above mentioned id = 1 & name = tom 
delete GET / the User / the Delete? ID = . 1

  rest style of writing

Query GET / the User? Name = tom 
details GET / the User / 1 
created POST / the User 
modify PUT / the User 
delete DELETE / the User / 1

 

1, Rest concept, from Baidu Encyclopedia

  That REST Representational state transfer (English: Representational State Transfer, REST for short) is proposed by Dr. Roy Fielding in his doctoral thesis in 2000 in a piece of software architectural style. It is a way for the design and development of network applications, it can reduce the complexity of the development, improve the scalability of the system.

  Currently the three major Web service implementation, since REST Web services model and complexity of SOAP and XML-RPC clear contrast in terms of a more concise, more and more began to use REST style web service design and implementation.

  

2, RESTful requirements

  1) a description URL resources;

  2) The method of HTTP using the described behavior; using HTTP status codes to indicate different results;

  3) using the interaction data to json;

  4) RESTful just a style, not a mandatory standard.

  Summary: Use the URL locate resources using the HTTP method of operating resources.

GET used to obtain resources; 
POST for new resources (can also be used to update the resource); 
PUT used to update the resource; 
DELETE to delete the resource

 

3、Glory of REST

  REST is a model of software interface design. REST Maturity Model: (https://www.mendeley.com/catalogue/richardson-maturity-model-steps-toward-glory-rest/)

  

 

reference:

  1) Detailed REST architectural style: http: //www.uml.org.cn/zjjs/201805142.asp

  2) REST, RESTful and explanation: https: //blog.csdn.net/qq_21383435/article/details/80032375

 

Guess you like

Origin www.cnblogs.com/xy-ouyang/p/11070161.html