当前位置:网站首页>Core concepts of rest
Core concepts of rest
2022-04-23 19:14:00 【Li Siwei】
REST(Representational State Transfer, Declarative state transitions )
resources
Every standard URL Can uniquely locate web A resource on the server .
When sending HTTP GET When asked , adopt URL To indicate where the resource to be requested is web Where on the server .
Resource expression
When web The client sends HTTP GET After the request , The server responds to the main content of the client , Is the expression of resources .
Every URL The resource being located is unique , However, the expression of resources can be diverse .
for example , For the information of a student stored on the server , The data can be filled into a beautiful... Designed by us HTML On the page , It can also be directly provided to the client for download in the form of plain text file .HTML And text files are different representations of the same resource .
Resource state
For the same URL, Send... At different points in time HTTP GET request , The response of the subject is likely to be different .
for example : At the beginning of class 1 of junior high school, there was 25 A student , The information of these students is managed through the student information management system , If we send a list of all students in class 1 at the beginning of school HTTP GET request , We will get 25 Bar record .
But three weeks after school , A student transferred in and joined class one of grade one , The student's information is also managed into the system . Then we send another URL Exactly the same HTTP GET request , The results are really different : Now the response body contains 26 Student records .
URL Exactly the same , In other words, it is a request for the same resource , But at different points in time , This resource has different states .
Declarative state transitions
The same resource has different states at different time points , When is the state of this resource 、 How did the transfer happen .
The answer is : Three weeks after the start of school, when new students transfer in , Its information is submitted to the management system , At this time , There is one HTTP POST The request is sent to the student information management system server , This request is to submit the information of new students to the system . It's this POST request , Changed the “ Information list of students in class 1 of junior high school ” The state of this resource .
“ Information list of students in class 1 of junior high school ” The state transition of this resource , Is written by a HTTP POST The request resulted in , And this POST Where does the main content of the request come from ? Is submitted from the client HTML Forms , This HTML The form is for the information of newly transferred students HTML describe , That is, the client sends a statement to the server —— New classmate's HTML The form changes the state of the resource ( Transfer )
REST Is a collection of design constraints
REST It's not an agreement 、 Nor is it a development framework , It's a collection of design constraints : No state 、 Using hypermedia as an application state engine .
版权声明
本文为[Li Siwei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210600381220.html
边栏推荐
- Openlayers 5.0 thermal diagram
- Tencent cloud GPU best practices - remote development training using jupyter pycharm
- std::stoi stol stoul stoll stof stod
- Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation
- [advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- mysql通过binlog恢复或回滚数据
- SQL server requires to query the information of all employees with surname 'Wang'
- Switching power supply design sharing and power supply design skills diagram
- Codeforces Round #784 (Div. 4)
猜你喜欢
![[记录]TypeError: this.getOptions is not a function](/img/c9/0d92891b6beec3d6085bd3da516f00.png)
[记录]TypeError: this.getOptions is not a function

开关电源设计分享及电源设计技巧图解

Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!

Using Visual Studio code to develop Arduino

Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique

Oracle configuration st_ geometry

Raspberry pie uses root operation, and the graphical interface uses its own file manager

Use of fluent custom fonts and pictures

c#:泛型反射
随机推荐
The type initializer for ‘Gdip‘ threw an exception
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
该买什么设备,Keysight 给你挑好了
在渤海期货办理开户安全吗。
Simplified path (force buckle 71)
mysql_linux版本的下載及安裝詳解
Using 8266 as serial port debugging tool
Simple use of viewbinding
Oracle配置st_geometry
mysql通过binlog恢复或回滚数据
SSDB基础
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
: app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
简化路径(力扣71)
开关电源设计分享及电源设计技巧图解
Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
SSDB基础3
Reflection on the performance of some OpenGL operations in the past
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary