URI stands for Uniform Resource Identifier. It is a string identifier that defines a resource on the internet. It is a string of characters that can identify any resource on the internet using location, name, or both.
URIs support a standard approach for resources to be created by several computers across a network or over the World Wide Web. It can be used by software programs including Web browsers and P2P file-sharing programs to find and download files.
There are two types of URI which are as follows −
URL − URL determines a location on the computer network and methods for fetching it.
URN − URN is an internet resource that determines the URN scheme.
URL stands for Uniform Resource Locator. It can find the location of the resource on the network. It is a quotation for a resource and a way to create that resource. A URL always displays a unique resource, and it can be an HTML page, a Cascading Style Sheets (CSS) document, an image, etc.
The syntax of URL is as follows −
Here, type specifies the type of server in which the file is located. The company used server types are HTTP (hypertext transfer protocol) and FTP (file transfer protocol) etc.
The domain name is the address of the server and the path specifies the location of the file on the server.
// is a kind of separator that tells the browser that the next words will be the actual URL.
The major differences between URI and URL are as follows −
|URI stands for Uniform Resource Identifier.||URL stands for Uniform Resource Locator.|
|A URI aims to recognise a resource and differentiate it from other resources by using the name of the resource or area of the resource.||A URL aims to find the area or address of a resource on the web.|
|It is generally used in XML and tag library files, including JSTL and XSTL, to recognise the resources and binaries.||It can be used to search the web pages on the internet.|
|A URI is a superset of URL that recognises a resource either by URL or URN (Uniform Resource Name) or both.||URL is a subset of URI that determines where a resource exists and the mechanism for retrieving it.|
|There is no protocol data given in URI.||Protocol data is given in the URL.|
|It can be used in HTML, XML and other files XSLT (Extensible Stylesheet Language Transformations) and more.||URL can locate only web pages.|
|It includes components like scheme, authority, path, query, fragment component, etc.||It includes components such as protocol, domain, path, hash, query-string, etc.|