Difference between Uri and URL

Source: Internet
Author: User

Uri: Uniform Resource Identifier, a unified resource identifier, used to uniquely identify a resource.

URL: Uniform Resource Locator, a uniform resource locator. It is a specific URI, that is, the URL can be used to identify a resource and also specify how to locate the resource.

URN: Uniform Resource name, which is used to identify a resource by name.

Uri is an abstract high-level concept that defines a unified resource identifier,

URL and urn are specific resource identifiers. URL and urn are both URI types.

 

In Java Uris, a URI instance can represent absolute or relative, as long as it complies with the URI syntax rules.

The URL class not only conforms to the semantics, but also contains information to locate the resource. Therefore, it cannot be relative and the schema must be specified.

 

If the path is absolute and can be located, it is okay to use imgurl,

If it is a relative path, do not use imgurl.

 

Summary:

A URL is a specific URI that not only uniquely identifies a resource, but also provides information for locating the resource.

Uri is a semantic abstract concept. It can be absolute or relative, while URL must provide sufficient information for locating. Therefore, it is absolute,

Generally, the relative URL is targeted at another absolute URL, which is basically absolute.

Note: Here, absolute (absolute) refers to scheme, while relative does not.

 

Difference between Uri and URL

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.