REST 概述首先简要介绍一下 REST。REST 代表 Representational State Transfer,它是 World Wide Web 所依赖的一套架构原则。Roy Fielding 在他的博士论文 “Architectural Styles and the Design of Network-based Software Architectures” 中首次提出了这个概念。在他的论文中,Fielding 明确指出 REST 和 World Wide Web 的五个架构原则:
可寻址性(Addressability)。REST 中的所有东西都基于资源 的概念。资源与 OOP 中的对象或其他名词不同,它是一种抽象,必须可以通过 URI 寻址或访问。