Uri is a uniform resource Descriptor (Uniform Resource Identifier). It is a mechanism used to describe resources on the Internet. We know that each web server resource has a name, so that other clients can reference and obtain the resource when they need it. The URI is like a postal address on the Internet, information resources can be identified and located globally.
URI includes two main forms: URL and urn. url is a uniform resource locator (Uniform Resource Locator), which is the most common form of Uri, a URL describes the specific location of a type of resource on a server.
Compared with Urn, a URL can clearly describe how to obtain resources of any type from a precise location. The URL format is as follows:
<Schema >://< user >:< password >@< host >:< port >/< path >;< Params>? <Query >#< frag>
From this representation, we can find that a URL must correspond to an existing physical resource, and its representation can be clearly pointed out:
1. How to obtain resources, that is, what protocol is used to obtain-schema;
2. User identification-user: password;
3. Where is the resource?-Host: Port, path
4. Get more fine-grained positioning of resources-query # frag, etc.
Urn is another form of Uri, which is called the Uniform Resource Name (Uniform Resource Name). Urn is the real name of the resource, it does not show how to obtain resources and where the resources exist. This is done by other service layers. It is just a name service for resources, this advantage is obvious: the relationship between the name of the decoupled resource and its location is not like the URL. if the location of the resource changes, the corresponding URL may become invalid, urn does not expire because of changes in the specific resource location. Another advantage is that you can use a uniform name to access resources through a variety of different network protocols.
Therefore, in a sense, urn is the true resource identifier, which solves the coupling relationship between the name and the location and the access protocol. Urn has the following forms:
URN: IETF: RFC: XXXXX
At present, the urn is still in the experimental stage.