Uniform Resource Identifier (URI) is a string of characters used to identify a resource on the internet. It provides a standardised method for naming or locating resources, such as web pages, files, or services, across various networks.
Structure of a URI:
A URI typically consists of the following components:
- Scheme: Specifies the protocol or type (e.g.,
http,ftp,mailto). - Authority: Contains information like the domain name or IP address (
example.com). - Path: Indicates the specific location of the resource on the server.
- Query (Optional): Additional parameters for the resource (e.g.,
?id=123). - Fragment (Optional): Refers to a specific part of the resource (
#section1).
Example URI:https://www.example.com/page?id=123#section1
Types of URIs:
- URL (Uniform Resource Locator): Specifies the location of a resource and how to access it.
- Example:
https://www.example.com
- URN (Uniform Resource Name): Identifies a resource uniquely without requiring its location.
- Example:
urn:isbn:978-3-16-148410-0
Importance:
URIs are fundamental to internet navigation and resource access, serving as the backbone of web technologies like APIs, browsers, and web applications.