What is the difference between a URI and a URL in an HTTP protocol?

Source: Internet
Author: User

URI = Universal Resource Identifier
URL = Universal Resource Locator

The Uniform Resource Identifier URI is the ability to uniquely identify a resource under a certain rule .
Take the example, assuming that all the names of the world can not be repeated, then the name is an instance of the URI, the name of the string can be identified by the unique person.
In reality, the name of course will be repeated, so the ID number is the URI, through the social Security number can let us can and only to identify a person.
What is the Uniform Resource Locator URL? Also take the example and then the HTTP URL to do an analogy, you can have:

Animal Address agreement://Earth/China/Zhejiang/hangzhou/West L. District/A university/No. 14th Dormitory/No. 525 bed/Zhang San. People

As you can see, this string also identifies the only person that acts as a URI, so the URL is a subset of the URI. A URL is one that uniquely identifies a person by its location.
In the above we can only identify a person with a social security number. For this Zhang San in Hangzhou, we can also use: ID Number: 123456789来 identify him.

So whether in the way of positioning or numbering, we can only identify a person, is an implementation of the URL, and the URL is the way to implement the URI.

Back to the web, assuming that all HTML documents have unique numbers, remember that html:xxxxx,xxxxx is a string of numbers, the ID number of an HTML document, which uniquely identifies an HTML document, then the number is a URI.
A URL is a URI that is implemented by describing the file on which path on the host is the only way to determine a resource, that is, the location.
For the current URL I prefer to call it URL, after all, it provides the location of resources information, if one day the URL by the number to identify into the/ http741236985.html , it would be more appropriate to call it a URI, but it would have to find a way to locate the resource ... Transferred from: https://www.zhihu.com/question/21950864/answer/154309494

What is the difference between a URI and a URL in an HTTP protocol?

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.