Return to site

[#restapis ] Difference between URI and URL

March 21, 2023

URI (Uniform Resource Identifier) and URL (Uniform Resource Locator) are often used interchangeably ๐Ÿ”„๏ธ, but they actually have different meanings ๐Ÿ˜ฏ.

A URI is a string of characters that identifies ๐Ÿ†” a resource. It can be used to identify any resource, whether it's a web page ๐ŸŒ, an image ๐Ÿ–ผ๏ธ, a document ๐Ÿ“„, or something else. A URI can be broken down into two parts: the scheme and the path. The scheme specifies the protocol to be used to access the resource (such as HTTP or FTP), and the path specifies the location of the resource.

A URL, on the other hand, is a type of URI that includes the location ๐Ÿ—บ๏ธ of a resource on the web ๐ŸŒ. It consists of the protocol scheme, a domain name (or IP address), and the path to the resource. A URL is a specific type of URI that provides a way to locate a resource on the web.

In summary, all URLs are URIs, but not all URIs are URLs. URIs are a more general concept that includes URLs and other types of resource identifiers.

๐Ÿ’ก Besides URLs, there are two other types of resource identifiers in URI:

1๏ธโƒฃ URN (Uniform Resource Name): URN is another type of URI that is used to identify a resource by its name ๐Ÿท๏ธ, rather than its location. A URN is a persistent identifier that remains valid even if the resource moves to a different location. Unlike URLs, URNs do not include information about how to access the resource.

2๏ธโƒฃ URC (Uniform Resource Citation): URC is a type of URI that is used to identify a resource in a citation ๐Ÿ—ฃ๏ธ or reference. URCs can include information about the author โœ๏ธ, publication date ๐Ÿ“…, and other metadata, in addition to the location of the resource.

In summary, while URLs identify resources by their location ๐Ÿ—บ๏ธ on the web, URNs identify resources by their name ๐Ÿท๏ธ, and URCs are used to identify resources in citations ๐Ÿ—ฃ๏ธ and references.

#rest #uri #url #difference