当前位置:网站首页>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
边栏推荐
- The platinum library cannot search the debug process records of some projection devices
- 2022.04.23(LC_714_买卖股票的最佳时机含手续费)
- mysql通过binlog恢复或回滚数据
- Matlab 2019 installation of deep learning toolbox model for googlenet network
- Redis common interview questions
- Customize the non slidable viewpage and how to use it
- Sogou cell thesaurus analysis (only extract words and word frequency)
- [报告] Microsoft :Application of deep learning methods in speech enhancement
- redis优化系列(三)解决主从配置后的常见问题
- Wechat applet part of the mobile phone Preview PDF did not respond
猜你喜欢
mysql通过binlog恢复或回滚数据
Installation, use and problem summary of binlog2sql tool
The platinum library cannot search the debug process records of some projection devices
[report] Microsoft: application of deep learning methods in speech enhancement
SQL常用的命令
redis优化系列(三)解决主从配置后的常见问题
JVM的类加载过程
Client interns of a large factory share their experience face to face
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
2022.04.23 (lc_763_divided into letter interval)
随机推荐
该买什么设备,Keysight 给你挑好了
SSDB基础3
SSDB Foundation
FTP、ssh远程访问及控制
Codeforces Round #783 (Div. 2) D题解
C1000k TCP connection upper limit test
Yyds dry goods inventory stringprep --- Internet string preparation
12 examples to consolidate promise Foundation
Using 8266 as serial port debugging tool
The type initializer for ‘Gdip‘ threw an exception
c1000k TCP 连接上限测试1
高层次人才一站式服务平台开发 人才综合服务平台系统
C: generic reflection
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
I just want to leave a note for myself
Esp01s with Arduino development environment
Codeforces Round #784 (Div. 4)
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
MySQL Téléchargement et installation de la version Linux
Class loading process of JVM