Uniform Resource Identifier (
URI) is a string of characters that identify and provide a means to access a resource on the Internet.
URIs serve as a unique identifier for resources such as web pages, files, or any other item that can be referenced or located.
URIs standardize and facilitate the identification and retrieval of resources across different systems and protocols.
URIs possess standardized syntax and formation for identification, enabling different systems and protocols to reference resources consistently.
URI can be broken down to illustrate the different components of a
The scheme defines the protocol or mechanism for accessing the resource. For example,
https:// for web page(s) or
ftp:// for file transfer, or
mailto: for email addresses. In our example, the scheme is
The authority specifies the domain or IP address of the server that hosts the resource. It may also include additional information such as usernames and passwords. In our example, the authority is
The path indicates the specific location or identifier for the resource within the server’s file system or namespace. It represents a hierarchical structure with directories and filenames. In our example, the path is
The query, indicated by a
?, allows for passing parameters or additional information to the resource. It is commonly used in web addresses to provide data to the server such as search queries. In our example, the query is
The fragment, represented by a hash symbol
# in the
URI, denotes a specific section or anchor within the resource. It is often used in web addresses to point to a specific section of a web page(s). In our example, the fragment is
The syntax and encoding of a
URI are specific and ensure proper identification and compatibility across different systems. You must properly encode the special and reserved characters in a
URI using percent-encoding. For example, a space is encoded as
%20 and ? as
%3F. In our example, we could specify the name within the query like so:
There are a few types of
URIs which are differentiated by their purpose and structure such as:
URI that specifies the web address or complete network location of a resource. URLs provide both an identifier and means to access the resource.