RESTful API 的代码需求约束

Code Demand Constraint for RESTful APIs

作为新手,我正在尝试了解 REST 及其原理。我已经阅读了一些关于它的文章,但很难理解 Code Demand Constraint 这是唯一的可选约束。它是什么 ?如何以及何时实施? 任何帮助将不胜感激。

Roy Fielding 的论文,实际上是 REST 的原始来源,defines the Code-On-Demand constraint as follows:

REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be pre-implemented. Allowing features to be downloaded after deployment improves system extensibility. However, it also reduces visibility, and thus is only an optional constraint within REST.

在撰写本文时,网络主要只是静态文档,唯一的 "web client" 是浏览器本身。现在,由 JavaScript 支持的 Web 应用程序使用 REST API 已司空见惯。这是按需代码的示例 - 浏览器获取初始 HTML 文档并支持该文档内的