- Hands-On Full Stack Development with Spring Boot 2.0 and React
- Juha Hinkula
- 266字
- 2021-06-25 21:00:25
Basics of REST
REST (Representational State Transfer) 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 the following:
- 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 be, 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 defines that every REST architecture should have 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 enough 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.
推薦閱讀
- Java多線程編程實戰指南:設計模式篇(第2版)
- TypeScript Essentials
- HTML5+CSS3基礎開發教程(第2版)
- 數據庫系統原理及MySQL應用教程
- 征服RIA
- Kotlin Standard Library Cookbook
- Java項目實戰精編
- Learning ArcGIS for Desktop
- Building RESTful Python Web Services
- Principles of Strategic Data Science
- 編程可以很簡單
- 3ds Max印象 電視欄目包裝動畫與特效制作
- Python從入門到精通(第3版)
- RESTful Web Clients:基于超媒體的可復用客戶端
- ActionScript 3.0從入門到精通(視頻實戰版)