一些图片来自于Scrimba的课程。
Rest is a design pattern to provide a standard way for clients and servers to communicate.
Rest是一种设计的模式,用来提供一种标准的客户端和服务端的通讯方式。
Princeples of REST:
- Client and Server separation
- Statelessness
- Accessing "Resources"
REST的原则:
- 客户端和服务端分离
- 无状态
- 获取资源
- What does a RESTful API usually return in response to incoming requests? JSON data
- RESTful API响应请求时通常返回的是JSON数据。
- What kind of client devices can make use of a RESTful API? ALL OF THEM.
- 所有客户端设备都可以使用RESTful API。
- What does it mean for the server to be "Stateless"? It forgets the interaction after the response is sent.
- 服务端的无状态指的是它会在发送响应后忘记当前的交互。