- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- Juha Hinkula
- 268字
- 2021-06-24 14:03:30
Basics of REST
Representational State Transfer (REST) is an architectural style for creating web services. REST is not standard, but it defines a set of constraints defined by Roy Fielding. The six constraints are as follows:
- Stateless: The server doesn't hold any information about the client state.
- Client server: The client and server act independently. The server does not send any information without a request from the client.
- Cacheable: Many clients often request the same resources; therefore, it is useful to cache responses in order to improve performance.
- Uniform interface: Requests from different clients look the same. Clients may include, for example, a browser, a Java application, and a mobile application.
- Layered system: REST allows us to use a layered system architecture.
- Code on demand: This is an optional constraint.
The uniform interface is an important constraint and it stipulates that every REST architecture should have the following elements:
- Identification of resources: There are resources with their unique identifiers, for example, URIs in web-based REST services. REST resources should expose easily understood directory structure URIs. Therefore, a good resource naming strategy is very important.
- Resource manipulation through representation: When making a request to a resource, the server responds with a representation of the resource. Typically, the format of the representation is JSON or XML.
- Self descriptive messages: Messages should have sufficient information that the server knows how to process them.
- Hypermedia and the Engine of Application State (HATEOAS): Responses can contain links to other areas of service.
The RESTful web service that we are going to develop in the following topics follows the REST architectural principles.
推薦閱讀
- CorelDRAW X6 中文版圖形設計實戰(zhàn)從入門到精通
- EDA技術與VHDL編程
- TCP/IP入門經(jīng)典(第5版)
- 物聯(lián)網(wǎng)概論(第2版)
- 中小型局域網(wǎng)組建、管理與維護實戰(zhàn)
- 夢工廠之材質(zhì)N次方:Maya材質(zhì)手冊
- 設備監(jiān)控技術詳解
- 轉化:提升網(wǎng)站流量和轉化率的技巧
- 云工廠:開啟中國制造云時代
- 路由與交換技術
- 5G新型多址技術
- 天下一家:網(wǎng)絡聯(lián)通世界(科學新導向叢書)
- 局域網(wǎng)組建與維護項目教程
- 網(wǎng)絡故障現(xiàn)場處理實踐(第2版)
- 新編 中文版CorelDRAW入門與提高