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

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.

主站蜘蛛池模板: 华容县| 象州县| 怀安县| 安远县| 凉城县| 海南省| 时尚| 闵行区| 枣阳市| 湛江市| 比如县| 文安县| 星子县| 上思县| 云阳县| 金沙县| 合阳县| 遂宁市| 万年县| 潢川县| 沁阳市| 苍南县| 西乌珠穆沁旗| 湖南省| 修文县| 诏安县| 衢州市| 贡觉县| 友谊县| 伽师县| 大余县| 抚顺市| 泸州市| 容城县| 郑州市| 博野县| 潍坊市| 榆林市| 尉犁县| 苏尼特右旗| 垫江县|