URI, URL, and URN

Source: Internet
Author: User

The URI is a uniform Resource identifier , and the URL is a uniform resource locator . Therefore, generally speaking, each URL is a URI, but not necessarily each URI is a URL. This is because the URI also includes a subclass, the Uniform Resource name (URN), which names the resource but does not specify how to locate the resource. The mailto, news , and ISBN URIs above are examples of urns.

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

An instance of this class represents a URI reference in the syntactic sense defined by RFC 2396. The URI can be absolute or relative. The URI string is parsed according to the general syntax, regardless of the scenario it specifies (if any) does not perform a lookup on the host (if any) and does not construct a schema-dependent stream handler. Equality, hash calculations, and comparisons are strictly defined based on the character content of the instance. In other words, a URI instance is similar to a structured string that supports syntactic, schema-dependent comparisons, normalization, parsing, and relative computations.

As a control, an URL instance of a class represents the syntax component of a URL and the information required to access the resources it describes. The URL must be absolute, that is, it must always specify a scenario. The URL string is parsed according to its schema. Typically a stream handler is established for the URL, and you cannot actually create a URL instance for a scenario that does not provide a handler. Equality and hash calculations depend on the scenario and the host's Internet address, if any, and no comparison is defined. In other words, a URL is a structured string that supports parsing of syntax operations and network I/O operations such as locating a host and opening a connection to a specified resource.

URI, URL, and URN

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.