1. 程式人生 > >URI, URL 和 URN區別

URI, URL 和 URN區別

cal because orm 給定 直接 site ons ESS 訪問

參考: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區別