Return to site

[#restapis ] Difference between URI and URL

· coding

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