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

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.

主站蜘蛛池模板: 南通市| 宁南县| 永靖县| 东辽县| 辛集市| 怀仁县| 墨竹工卡县| 休宁县| 昌黎县| 炉霍县| 长岛县| 涿州市| 叙永县| 连云港市| 邛崃市| 德兴市| 岫岩| 文登市| 山丹县| 阜阳市| 盐源县| 工布江达县| 淮北市| 南雄市| 洛隆县| 论坛| 睢宁县| 汝州市| 纳雍县| 黄骅市| 乌拉特中旗| 岳西县| 柏乡县| 山阴县| 景宁| 海丰县| 临江市| 泾源县| 渝北区| 平塘县| 北碚区|