RESTful Web Services理论简介
Representational State Transfer(REST) 既不是技术也不是标准,而是一种软件架构风格,是基于Web暴露
资源的一系列指南。基于HTTP进行传输数据,使用基本的HTTP verbs.
1. 基本的REST Principles
- Application state and functionality are divided into resources;
- Resources are addressable using standard URIs that can be used as hypermedia links;
- All resources use only the four HTTP verbs:DELETE,GET,POST,PUT;
- All resources provide information using the MIME types supported by HTTP;
- The protocol is stateless;
- Responses are cacheable;
- The protocol is layered.
2. REST Best Practices
- 提供一个唯一的URI 给Expose的 Resource;
- URI中精良使用名词;
- GET verb不会改变任何数据;
- 响应中使用Links;
- 服务无状态;
3. HTTP Verbs
- GET: 查找
- PUT: 更新(如果需要更新的资源不存在将进行插入操作)
- POST: 插入
- DELETE: 删除
4. JAX-RS
创建REST架构风格的WebService的规范。
相关推荐
Eiceblue 2020-08-02
ahnjwj 2020-07-28
playis 2020-06-28
playis 2020-06-16
ahnjwj 2020-06-12
84560296 2020-06-10
84560296 2020-06-09
84560296 2020-06-08
84560296 2020-05-30
81901836 2020-05-26
beibeijia 2020-05-16
85291545 2020-05-01
84560296 2020-04-10
fanix 2020-04-09
bapinggaitianli 2020-04-07
84560296 2020-03-27
85291545 2020-03-26
82911731 2020-03-25