Skip to content
Author: Tianle Yuan

Uniform Resource Identifier(URI)⚓︎

In web development we always say endpoints. The concept refers to URI + HTTP request method (GET, POST, etc.). So what is URI, what is the difference between URI and URL?


What is URI and URL
  • URI: Uniform Resource Identifier.

  • URL: Uniform Resource Locator.


Difference between URI and URL?
  • URI identifies a resource and differentiates it from others by using a name, location, or both.
  • URL identifies the web address or location of a unique resource.

picture 1

picture 2


Syntax of URI/URL


picture 3

The first component of a URI defines the addressing system:

  1. in some cases, it is a protocol used to access a resource.
  2. meanwhile, other techniques may NOT specify any protocol.

Scheme can contain any combination of letters, digits, plus signs, periods, or hyphens followed by a colon. The most common URI schemes include HTTP, HTTPS, FTP, mailto, and file.

  1. HTTP (Hypertext transfer protocol) – allows users to access data from web pages using hypertext links.
  2. HTTPS (Hypertext transfer protocol secure) – protects data transmission between the user’s browser and site.
  3. FTP (File transfer protocol) – used for a file transfer between different devices via a network.


An optional component preceded by a double slash and terminated by a slash, a question mark, or a hash symbol. It consists of three sub-components:

  1. Userinfo – includes a username and a password separated by a colon.
  2. Host – consists of either an IP address or a registered name. The IP address should be inserted into brackets.
  3. Port – a protocol used for connecting the server. It is an optional sub-component followed by a colon.

e.g. file:(//)

The thrid component contains a sequence of data segments that describes the location of a resource in a directory structure. It should be empty or separated by a slash.

e.g. telnet:// (valid URI with an empty path)

e.g. foo:// ?fred (valid URI with an empty path)

e.g. file:(//)

A component that contains a query string of non-hierarchical data. It is often a string of key=value pairs. This component is preceded by a question mark.


This optional component includes a fragment identifier that provides the direction to a secondary resource. A fragment is preceded by a hash symbol and terminated by the end of a URI.



Last update: February 27, 2023 00:42:01
Created: December 4, 2022 07:37:10