"Stateless" of HTTP and "state transition" of rest

Xiangxi assassin Wang Hu 2021-02-23 16:44:03
stateless http state transition rest

" No state " Of HTTP

understand HTTP Stateless protocol , Need to understand HTTP Of “ There is no connection ” sex , It's about a request generating a connection , Request processed , Connect and disconnect . So the information communication between client and server is one-time .
Corresponding “ There is a connection ” sex , You can use TCP, Or it specifies Keep-Alive Of HTTP Connect to represent .

because HTTP No connectivity of , The server does not reserve the status information of the client , That is, there is no consistency between the content of a single request and the last request , The client needs to transfer all the information in each request , And the results of the request are not related to each other .

Of course , With session and cookie, Everything is different

The explanations on the Internet are rather vague , There is an in-depth post to refer to : http Protocol stateless " state " What exactly is it ?!

can “ State transition ” Of REST

REST Inside ST(state translate), refer to RE The performance layer represented by , That is to say, it is aimed at all kinds of information about resource status provided URI Speaking of , For state transitions , That's how I understand it :
For the exposed service resources , according to REST My style demands , A set of CRUD Service support of operation method , and CRUD action , It will have a significant impact on the state of the corresponding resources ( except R), So the state here , It's about resources , The result of a request .

Such as , For a student information resource portal /student/{studentId}/ , The submitted CRUD The request will cause the status of the specific student information resource to change to created 、 Obtained ( If there is )、 Updated 、 deleted

therefore , these two items. “ state ”, It doesn't mean the same thing .

本文为[Xiangxi assassin Wang Hu]所创,转载请带上原文链接,感谢

  1. J2EE
  2. Vue uses SDK to upload seven cows
  3. k8s-dns
  4. JavaScript mailbox verification - regular verification
  5. k8s-dashboard
  6. How many questions can you answer?
  7. Spring annotation -- transactional
  8. [k8s cluster] construction steps
  9. k8s-kubeadm
  10. k8s-etcd
  11. Using HashMap to improve search performance in Java
  12. There is no class problem when Maven publishes jar package
  13. JavaScriptBOM操作
  14. J2EE
  15. k8s-prometheus-memory
  16. k8s-prometheus disk
  17. k8s-prometheus
  18. JavaScript BOM operation
  19. k8s-prometheus-memory
  20. k8s-prometheus disk
  21. k8s-prometheus
  22. Linux Disk Command
  23. Linux FS
  24. 使用docker-compose &WordPress建站
  25. Linux Command
  26. This time, thoroughly grasp the depth of JavaScript copy
  27. Linux Disk Command
  28. Linux FS
  29. Using docker compose & WordPress to build a website
  30. Linux Command
  31. 摊牌了,我 HTTP 功底贼好!
  32. shiro 报 Submitted credentials for token
  33. It's a showdown. I'm good at it!
  34. Shiro submitted credentials for token
  35. Linux Stress test
  36. Linux Root Disk Extension
  37. Linux Stress test
  38. Linux Root Disk Extension
  39. Redis高级客户端Lettuce详解
  40. springboot学习-综合运用(一)
  41. 忘记云服务器上MySQL数据库的root密码时如何重置密码?
  42. Detailed explanation of lettuce, an advanced client of redis
  43. Springboot learning integrated application (1)
  44. Linux File Recover
  45. Linux-Security
  46. How to reset the password when you forget the root password of MySQL database on the cloud server?
  47. Linux File Recover
  48. Linux-Security
  49. LiteOS:盘点那些重要的数据结构
  50. Linux Memory
  51. Liteos: inventory those important data structures
  52. Linux Memory
  53. 手把手教你使用IDEA2020创建SpringBoot项目
  54. Hand in hand to teach you how to create a springboot project with idea2020
  55. spring boot 整合swagger2生成API文档
  56. Spring boot integrates swagger2 to generate API documents
  57. linux操作系统重启后 解决nginx的pid消失问题
  58. Solve the problem of nginx PID disappearing after Linux operating system restart
  59. JAVA版本号含义
  60. The meaning of java version number