码迷,mamicode.com
首页 > Web开发 > 详细

URI, URL 和 URN区别

时间:2018-10-11 21:47:00      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:summary   tps   ati   rds   访问   item   while   nes   ide   

参考: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是一个更小集合。)

 

URI, URL 和 URN区别

标签:summary   tps   ati   rds   访问   item   while   nes   ide   

原文地址:https://www.cnblogs.com/Daomy/p/9774660.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!