Uniform Resource Identifier (URI)
A string of characters that uniquely identifies a resource on the internet.
URL
A Uniform Resource Locator (URL) is a specific type of URI that provides the address of a resource and how to access it.
All URLs are URIs, but not all URIs are URLs.
Characteristics of URIs
- Uniqueness:
- Each URI is unique, ensuring that it identifies only one resource.
- This uniqueness is crucial for avoiding confusion and ensuring accurate resource retrieval.
- Scheme:
- The scheme specifies the protocol used to access the resource, such as http , https , ftp , or mailto.
- Flexibility:
- URIs can identify resources in various ways, including by location (URL) or by name (URN).
- Syntax:
- URIs follow a specific syntax defined by standards like RFC 3986.
- This ensures consistency and interoperability across different systems.
mailto:info@example.com
This URI identifies an email address using the mailto scheme.
Characteristics of URLs
- Location-Based:
- URLs provide the exact location of a resource, such as a web page or file.
- Components:
- A URL consists of several components, including the scheme, host, path, and optional query parameters.
- Accessibility:
- URLs not only identify a resource but also provide the information needed to access it, such as the protocol and server address.
- Human-Readable:
- URLs are designed to be easily readable and understandable by humans, making them user-friendly.
https://www.example.com/page?user=123
This URL specifies the https scheme, the host www.example.com , the path /page , and a query parameter user=123.
Differences Between URIs and URLs
- Scope:
- URIs are a broader concept that includes URLs and URNs.
- URLs are a subset of URIs focused on location-based identification.
- Functionality:
- URIs can identify resources by name or location.
- URLs specifically provide the address and access method for a resource.
A URI could be urn:isbn:0451450523 (a book identifier), while a URL could be https://www.example.com (a web address).