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

Resource identification

Resources will be identified in requests. For example, a resource in a web-based REST system will be identified by the URI. And no matter how a resource is stored on the server, it will remain separate from what will be returned to the client in the response.

In fact, resource storage on the server is an implementation but the request and response is what a client is interacting with, so it is like an interface to the client. And a client can identify a resource by this interface. So all that a client knows is what it is requesting and getting in response.

For example, a client usually sends a request to the URI and gets a response in the form of HTML, JSON, or XML. None of these formats are how the server stores data internally in the database or somewhere else on the server. But for a client, it is the URI where it will hit and the HTML, JSON, and XML is what it gets.

This is what a resource is for a client, no matter how it is stored on the server. And this is the benefit, because no matter if the server's internal logic or representation is changed, for the client it will remain the same because the client sends the request to the URI and gets a response in the form of HTML, JSON, or XML and not how it is stored on the server. This constraint, results in loose coupling of resource identification and representation.

主站蜘蛛池模板: 扶风县| 金平| 大化| 西和县| 若尔盖县| 包头市| 民和| 高邮市| 新闻| 分宜县| 岐山县| 青海省| 临城县| 宿州市| 荣成市| 武汉市| 万州区| 施秉县| 岳普湖县| 华安县| 登封市| 开封市| 海宁市| 靖江市| 宁晋县| 分宜县| 漾濞| 台中市| 宾川县| 大化| 文山县| 三原县| 民县| 无为县| 班戈县| 上饶市| 巴林左旗| 肃宁县| 罗江县| 德兴市| 石门县|