URI, URL 和 URN区别

参考:https://danielmiessler.com/study/url-uri/

URN:  A Uniform Resource Name,统一资源名称 ;eg.     ietf.org/rfc/rfc2396.txt(给定URI,我们仍无法访问该资源,因为我们不知道是在http协议还是ftp协议亦或者是其他协议)

URL:Uniform Resource Locator,统一资源定位符;eg.     http://www.ietf.org/rfc/rfc2396.txt  (可以定位资源的地址,即给定URL,我们就能找到这个资源)

URI:Uniform Resource Identifier,统一资源标识符。One can classify URIs as locators (URLs), or as names (URNs), or as both. A Uniform Resource Name (URN) functions like a person’s name, while a Uniform Resource Locator (URL) resembles that person’s street address. In other words: the URN defines an item’s identity, while the URL provides a method for finding it。即:URN和URL都是URI的子集. 所以任何的URN和URL都可以称之为URI。

Summary:

  1. URIs are identifiers, and that can mean name, location, or both.(URI既可以是资源名字,也可以是资源定位符,或者两者都是)
  2. All URNs and URLs are URIs, but the opposite is not true.(URN和URL都是URI,但反之不成立)
  3. The part that makes something a URL is the combination of the name and an access method, such as https://, or mailto:.(URL是由名字和访问方式(访问协议)组成的)
  4. All these bits are URIs, so saying that is always technically accurate, but if you are discussing something that’s both a full URL and a URI (which all URLs are), it’s best to call it a “URL” because it’s more specific.(专业来说,直接用URI总是正确的,但如果是属于URL范畴的URI,直接使用URL这种称呼会更精确,因为URL是一个更小集合。)

猜你喜欢

转载自www.cnblogs.com/Daomy/p/9774660.html
今日推荐