Spring Boot 2.x 编写 RESTful API (一) RESTful API 介绍 & RestController

用Spring Boot编写RESTful API 学习笔记

RESTful API 介绍

  • REST 是 Representational State Transfer 的缩写
  • 所有的东西都是资源,所有操作都通过对资源的增删改查 (CRUD) 实现
  • 对资源的增删改查对应对 URL 的操作 (POST, DELETE, PUT, GET)
  • 无状态的

URL 中都应该是名词,不应该出现动词

关于 RESTful API 更详细可参考阮一峰老师的 RESTful API 最佳实践

RestController

源码:spring-boot-2-restful

原文地址:https://www.cnblogs.com/victorbu/p/10653865.html