In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "what are the basic concepts of REST". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Basic concepts of REST:
Everything in REST is considered a resource.
Each resource is identified by URI.
Use a unified interface. Processing resources uses POST,GET,PUT,DELETE operations similar to create, read, update, and delete (CRUD) operations.
Stateless. Each request is a separate request. Every request from the client to the server must contain all the necessary information for easy understanding.
Communications are all through presentation. For example, XML,JSON
From the point of view of state, a new idea of transplanting state to client is put forward. A unified Web view is proposed, which is suitable for both client-side and server-side applications. It is suitable for Bax S, C, S, S. The difference between the HTTP client and the HTTP server does not matter to the architecture. One software should be able to act as both a Web client and a Web server without having to use two completely different sets of APIs.
Provide a unified method of resource operation: POST, GET, PUT, DELETE, hypertext or hypermedia driven (hypertext/Hypermedia) state transition is the core of the REST architecture. The operation brings about the state change, and the state transfer traversal is realized by link navigation.
As shown in the following figure: first, access all the current resources (2) through the GET method access / well-known-uri (1), and then select one of the resource names FooService to access / well-known-uri/foo (3) through the Get method to get the resource list under foo.
Foo may be a domain model or other resource that represents the core of the business. Suppose foo is an order. If a user wants to change the status of an order, such as canceling an order, once the cancel order button is clicked, the client will issue a PUT command (5) to / well-known-uri/foo/reverse to cancel the order, which is actually a command to modify the status of the order.
The client issues the GET command (6) again to obtain the result that the state has changed.
It is worth noting that when the PUT command is issued, the result of the business operation is not usually returned immediately by the server, but 200 of Http is returned, indicating that the PUT operation is completed. The specific business result must be obtained by the client again according to the URI resources in the resource list obtained in step 3, and the query command must be issued by the client again (6).
This is the end of the content of "what are the basic concepts of REST". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.