URI: Uniform Resource Identifier (Uniform Resource Identifier). is a generic concept.
URL: Uniform Resource Locator (Uniform Resource Locator). Represents the actual address of the resource in the server.
URN: Uniform Resource Name (Uniform Resource name). Provides a stable name for the object.
Uri
A class of generic resource identifiers. Consists of two main subset URLs and urns.
Url
The URL provides a unified naming scheme: "Scenario://server Location/path" (such as http://www.baidu.com/index.html):
Scenario (Sheme): informs the WEB client of the protocol used to access the resource, such as: http;
Server location (host): tells the Web client where the resource is located, such as: www.baidu.com;
Path: The requested resource is located at a specific location on the server, such as:/index.html.
A URL defines where and how a user needs a specific resource, and can point to any resource on the Internet.
URL syntax
URL syntax differs depending on the scenario (such as HTTP, FTP, SMTP), but most URLs follow the common URL syntax.
<scheme>://<user>:<password>@
Scenario (Sheme): tells the application to parse the URL, what protocol to use, and the scenario name is case-insensitive.
Host: Identifies the host machine on the Internet that can access resources. Can be represented by host name or up address.
Port: Identifies the network port that the server is listening on. Commonly used default ports, please refer to: http://www.wusiwei.com/?post=109
User name and password (password): Many servers require a user name and password to allow users to access data, such as FTP, and a default user name and password are inserted if the user does not provide it. such as Ftp://anonymous:[email Protected]/pub/gnu.
Path: Indicates that the resource is located in a specific place on the server.
Parameter (params): To properly interact with the server, provide the required protocol parameters to the application that is responsible for parsing the URL. A list of name-value pairs. The path component of the HTTP URL can be divided into several path segments, each of which can have its own parameters, for example: Http://www.joes-haniware.com/hammers;sale=false/index.html;graphocs=true
String (query): Reduces the range of requested resource types by asking questions or making queries. The query string typically appears as a series of "name/value" pairs, separated by the character "&".
Fragment (Frag): A fragment that references a portion of a resource or resource. The HTTP server typically handles only the entire object, that is, the fragment value is changed, and no request is sent to the HTTP server, so the URL fragment is only used by the client.
Urn
URLs are a powerful tool, but URLs are not perfect, they represent actual addresses, not exact names, meaning that URLs cannot locate objects when they are moved. If you have an exact name for the object, you can find the object wherever it is located. The URN provides a stable name for the object.
PURL: Permanent Uniform Resource Locator (persistent Uniform Resource locators). is an example of using a URL to implement URN functionality. The basic idea is to introduce another middle tier in the search for resources, ranking and tracking the actual URLs of resources through an intermediary resource Locator (resource Locator) server. The client requests a persistent URL to the locator, and the locator can respond with a resource, redirecting the client to the current actual URL of the resource.
Since converting from a URL to a urn is a huge project, the process of standardizing is slow and the urn is now unused.
Reference: HTTP authoritative Guide
URI, URL, URN