URI, URL, urn simple description

Source: Internet
Author: User
Tags rfc

Rr.

Each Web server resource has a name so that the client can indicate that the resources they are interested in are

What's up. The server resource name is called the Uniform Resource Identifier (Uniform Resource Identifier,uri).

URIs, like postal addresses on the Internet, uniquely identify and locate information resources around the world.

This is Joe's hardware store. The URI of the previous picture resource on the Web server:

Http://www.joes-hardware.com/specials/saw-blade.gif


Figure 1

Figure 1 shows how the URI instructs the HTTP protocol to access the image resources on the Joe Store server.

Given the uri,http, you can parse the object. There are two forms of URIs, called URLs and urns, respectively.

Url

The Uniform Resource Locator (URL) is the most common form of resource identifiers. A URL describes a specific location of a resource on a particular server. They can clearly explain how to get resources from a precise, fixed location. Figure 1 shows how the URL accurately describes the location of a resource and how to access it.

URL instance:

http://www.oreilly.com/index.html O ' Reilly &associates Company's main URL

Http://www.yahoo.com/images/logo.gif Yahoo! 's Web site flag URL

http://www.joes-hardware.com/inventory-check.cgi?item=12731 a URL to view the inventory entry #12731 if there is a spot in the program

Ftp://joe:[email protected]/lockingpliers.gif password-protected FTP as the Access Protocol locking

Most URLs follow a standard format, which consists of three parts.

? The first part is called scheme, which describes the type of protocol used to access the resource. This section is usually the HTTP protocol (//).

? The second part gives the server's Internet address (for example, www.joes-hardware.com).

? The third section specifies a resource (for example,/specials/saw-blade.gif) on a WEB server.

Now, almost all URIs are URLs.

URLs are available in two ways: absolute and relative. The absolute URL contains all the information that is required to access the resource. On the other hand, the relative URL is incomplete. To get all the information needed to access a resource from a relative URL, it must be parsed relative to another, known as its base (base) URL. A relative URL is a convenient, abbreviated method of URL. If you have written HTML, you may find that the relative URL is very convenient. Figure 2 is an instance of an HTML document with a relative URL embedded in it.

Figure 2

Figure 2 is a resource: An HTML document for http://www.joes-hardware.com/tools.html.

In this HTML document, there is a hyperlink that contains the URL./hammers.html. This URL appears to be incomplete, but is actually a valid relative URL. It can be interpreted relative to the URL of the document in which it is located, in this case the resource/tools of the hardware store Web server relative to Joe. Html.

The base URL is: http://www.joes-hardware.com/tools.html with this URL as the basis, you can push to export the missing information. We know that the resource name is./hammers.html, but we don't know what the scheme or hostname is. With this base URL, you can deduce that the scheme is HTTP and the host is www.joes-hardware.com. This is illustrated in Figure 3.


Figure 3

Urn

The second form of a URI is a Uniform Resource name (URN). A URN is used as a unique name for a specific content, regardless of where the current resource is located. With these location-independent urns, you can move resources around. With a urn, you can also access resources through multiple network access protocols with the same name.

For example, regardless of where the Internet standard document RFC 2,141 is located (and can even be copied to multiple places),

You can name it with the following urn:

urn:ietf:rfc:2141

The URN is still in the experimental phase and is not yet in wide use. To work more effectively, the URN needs a support architecture to parse the location of the resource. The lack of such architectures has also slowed the pace of adoption.

URI, URL, urn simple description

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.