您的位置:首页 > 大数据 > 人工智能

URI vs URL vs URN

2011-12-11 19:59 676 查看
URI - a string of characters for identifying a resource. A URI can be further classified as a locator (URL), a name (URN), or both.

<scheme>:<scheme-specific-part> (this syntax apply to any URI)

<scheme>://<authority><path>?<query> (this syntax apply to some of the URI)

URI that are hierarchical in nature use the slash "/" character for separating hierarchical components. "//" is for net path.

 

URL (locator) - a type of URI that's used to describe the
location of a specific resource. A URL doesn't define the type of the resource to be found (text, image, movie, etc.), it only says where and how to find it.

RFC definition - The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource
by name or by some other attribute(s) of that resource.

protocal://computer(domain name or IP)/directories/file
http://www.igt.com/iplatform/index.html
file://localhost/home/readme.txt

file://localhost/c:/download/help.html

file:///c:/download/help.html

 

URN (name) - is a type of URI that uses the "urn" scheme. It is uniquely identify a resource irrespective of its stored location.

urn:isbn:04510523

urn:ietf:rfc:2668

RFC definition - The term "Uniform Resource Name" (URN) refers to the subset of URI that are required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息