what is resful
Rest is a development style , it is not a framework, nor a class library, it is a convention
what is the difference
Non-restful way of development
When restful is not touched, the URL is usually a verb, such as 127.0.0.1:8080/unrestful/getFile
RESTful way of development
The restful URL is a noun, such as 127.0.0.1:8080/restful/file
Call a specific business through the method of the request message
the agreed method
- get, get data
- post, add data
- put, update data
- delete, delete data
convention over configuration
After agreeing on what kind of business the methods of get, post, put and delete should handle, the background will call the corresponding method according to the requested method.
Instead of getting it from the configuration file, the action method corresponding to the request method
benefit
Restful development can make the URL of the interface more concise and less
View the original text: http://www.wewill.top/2016/06/07/restful%E6%98%AF%E4%BB%80%E4%B9%88/