区别URI和URL

2019-10-08 15:34 来源:未知

  自己在看《图解HTTP》的时候,刚初叶还对UPRADOI和UGL450L的界别不是太注意,越到背后越开掘差距两个的须要性。

  葡萄牙语文书档案:“A U大切诺基I is a uniform resource identifier while a URL is a uniform resource locator. Hence every URL is a URI, abstractly speaking, but not every URI is a URL. This is because there is another subcategory of URIs, uniform resource names (URNs), which name resources but do not specify how to locate them. The mailto, news, and isbn URIs shown above are examples of URNs.

The conceptual distinction between URIs and URLs is reflected in the differences between this class and the URL class.

An instance of this class represents a URI reference in the syntactic sense defined by RFC 2396. A URI may be either absolute or relative. A URI string is parsed according to the generic syntax without regard to the scheme, if any, that it specifies. No lookup of the host, if any, is performed, and no scheme-dependent stream handler is constructed. Equality, hashing, and comparison are defined strictly in terms of the character content of the instance. In other words, a URI instance is little more than a structured string that supports the syntactic, scheme-independent operations of comparison, normalization, resolution, and relativization.

An instance of the URL class, by contrast, represents the syntactic components of a URL together with some of the information required to access the resource that it describes. A URL must be absolute, that is, it must always specify a scheme. A URL string is parsed according to its scheme. A stream handler is always established for a URL, and in fact it is impossible to create a URL instance for a scheme for which no handler is available. Equality and hashing depend upon both the scheme and the Internet address of the host, if any; comparison is not defined. In other words, a URL is a structured string that supports the syntactic operation of resolution as well as the network I/O operations of looking up the host and opening a connection to the specified resource.”

  华语文书档案:"UCRUISERI 是联独财富标识符,而 ULANDL 是统一能源定位符。由此,笼统地说,每种 U智跑L 都以 ULacrosseI,但不自然每个 U奥德赛I 都以 U奥迪Q7L。那是因为 U君越I 还包含贰个子类,即联独能源名称 (U奥迪Q5N),它命名财富但不点名怎么样稳固财富。上边的 mailtonews 和 isbn URI 都是 URN 的示例。

UCRUISERI 和 UKugaL 概念上的不如映未来此类和 URL 类的不相同中。

此类的实例代表由 RFC 2396 定义的语法意义上的二个 U库罗德I 引用。U福特ExplorerI 能够是绝对的,也能够是对峙的。对 U宝马X5I 字符串依照平时语法进行深入分析,不思量它所钦点的方案(若是有)不对主机(尽管有)试行查找,也不组织注重于方案的流管理程序。相等性、哈希计算以及比较都严俊地依据实例的字符内容进行定义。换句话说,一个UEvoqueI 实例和三个支撑语法意义上的、重视于方案的可比、规范化、分析和相对化总结的结构化字符串大约。

用作对照,URL 类的实例代表了 U帕杰罗L 的语法组成都部队分以及拜见它叙述的能源所需的消息。UPAJEROL 必得是纯属的,即它必须一贯钦点二个方案。UXC90L 字符串依照其方案进行分析。日常会为 UMuranoL 创设多个流管理程序,实际上不可能为未提供管理程序的方案创制二个 U福睿斯L 实例。相等性和哈希总结信任于方案和主机的 Internet 地址(若是有);未有定义比较。换句话说,U兰德酷路泽L 是一个布局化字符串,它协理剖析的语法运算以及查找主机和开荒到钦命能源的连接之类的网络I/O 操作。

"

  以上是从官方文书档案对于URAV4I的表明中出现的,对于U瑞虎I、U凯雷德L、UQashqaiN的区分。简单地看,能够用二个报表来证实那三者的分别。

名词

特性

URI统一资源标识符

既可以相对地也可以绝对地标识一个资源的地址

URL统一资源定位符

是比URI更具体形式,只能是绝对地标识一个资源的地址

URN统一资源名称

只命名一个资源但不指定如何定位资源

  

  参照他事他说加以考察网站:

       

TAG标签:
版权声明:本文由澳门国际银河备用网址发布于澳门国际银河备用网址,转载请注明出处:区别URI和URL