[英]There is a name for this technique of mapping url?
而是以這種模式構造url:
http://www.mysite.com/user/view?name=michele&age=30
寫這樣的東西:
http://www.mysite.com/user/view/name/michele/age/30
要么
http://www.mysite.com/user/view,name-michele,age-30
等等。
我相信您正在尋找的就是REST:
代表性狀態轉移(REST)是一種體系結構樣式,由一組協調的體系結構約束集組成,這些約束應用於分布式超媒體系統中的組件,連接器和數據元素。 REST忽略了組件實現和協議語法的細節,以便將精力集中在組件的角色,與其他組件的交互上的約束以及對重要數據元素的解釋上。
遵守REST約束的Web服務API稱為RESTful。
+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+
| Resource | GET | PUT | POST | DELETE |
+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+
| Collection URI, such as http://example.com/resources | List the URIs and perhaps other details of the collection's members. | Replace the entire collection with another collection. | Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation. | Delete the entire collection. |
| Element URI, such as http://example.com/resources/item17 | Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. | Replace the addressed member of the collection, or if it doesn't exist, create it. | Not generally used. Treat the addressed member as a collection in its own right and create a new entry in it. | Delete the addressed member of the collection. |
+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+
更多: http : //en.wikipedia.org/wiki/Representational_state_transfer
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.