- Hands-On Full:Stack Web Development with ASP.NET Core
- Tamir Dresher Amir Zuker Shay Friedman
- 262字
- 2021-06-10 19:37:16
Representational State Transfer
Representational state transfer (REST) is an architectural style for resource-oriented services. It is used by most web applications today to standardize communication between the client and the server. If HTTP was the spoken language, REST would be a set of rules for that language.
REST-based web services, also known as RESTful APIs, have a few constraints they need to follow:
- Consistent interface: Every entity is a resource that will have a unique endpoint— a unique base URL. All operations on a resource will be available via that URL.
- URL and HTTP methods: When a resource URL is combined with an HTTP method, it describes an operation performed on the resource. For example, GET means retrieving data, POST means creating data, and DELETE means deleting data.
- Statelessness: Just like the HTTP protocol, RESTful services are stateless. This means that each request is independent and information regarding previous requests is never used.
- Cacheable: For each response, the server defines whether it is cacheable or not. Once a response is set as cacheable, the client caches it and uses the data from the cache instead of requesting it from the server again and again.
For example, in an application that manages students, we could have the following services:

REST has become the de facto style of communication between the backend and the frontend. This is especially because it is a simple concept, yet very powerful — it makes the backend understandable to other developers and simple to modify and scale, and supports multiple types of clients, including web and mobile.
- 面向物聯(lián)網(wǎng)的CC2530與傳感器應(yīng)用開發(fā)
- 物聯(lián)網(wǎng)(IoT)基礎(chǔ):網(wǎng)絡(luò)技術(shù)+協(xié)議+用例
- 計算機(jī)網(wǎng)絡(luò)安全實(shí)訓(xùn)教程(第二版)
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實(shí)戰(zhàn)
- 智慧光網(wǎng)絡(luò):關(guān)鍵技術(shù)、應(yīng)用實(shí)踐和未來演進(jìn)
- 面向5G-Advanced的關(guān)鍵技術(shù)
- Practical Web Penetration Testing
- 信息技術(shù)安全評估準(zhǔn)則:源流、方法與實(shí)踐
- INSTANT Social Media Marketing with HootSuite
- 趣話通信:6G的前世、今生和未來
- 加密與解密實(shí)戰(zhàn)全攻略
- LiveCode Mobile Development Beginner's Guide
- 網(wǎng)絡(luò)設(shè)備配置與調(diào)試項目實(shí)訓(xùn)
- 夢工廠之沸騰關(guān)鍵幀:Maya動畫手冊