官术网_书友最值得收藏!

Code on demand (optional)

This states that the server can add more functionality to the REST client, by sending code that can be executable by that client. In the context of the web, one such example is JavaScript code that the server sends to the browser.

Let's consider an example to understand this better.

For example, a web browser acts like a REST client and the server passes HTML content that the browser renders. At the server side, there is some sort of server-side language which is performing some logical work at the server side. But if we want to add some logic which will work in the browser then we (as server-side developers) will have to send some JavaScript code to the client side and the browser and then execute that JavaScript code. So that the JavaScript code can add validation to a form, some animation or anything else, that couldn't be possible simply in HTML content. That JavaScript code is code on demand which the server sends to the client that extends the functionality of the REST client.

Note that sending code on demand to the client is optional, and not required if we don't want to extend the client's functionality.

主站蜘蛛池模板: 汉源县| 辉南县| 宁国市| 绥滨县| 天峻县| 将乐县| 岑巩县| 玛曲县| 灌云县| 家居| 红河县| 日土县| 增城市| 民丰县| 武宁县| 望奎县| 龙口市| 连山| 开封市| 抚宁县| 新泰市| 临猗县| 托克托县| 会泽县| 开化县| 合阳县| 西丰县| 芜湖市| 康马县| 海兴县| 东台市| 阳新县| 什邡市| 柏乡县| 同仁县| 五指山市| 昌都县| 西昌市| 泾阳县| 滨州市| 曲沃县|