URI
Published Jun 25, 2022
Contribute to Docs
A Uniform Resource Identifier (URI) is a string that refers to a resource used by a web technology like a browser or an API.
Syntax
|----------------------------URL-------------------|
| |--------------------------URN------------|------|
scheme://domain:port/path/to/resource?query=params#fragment
|----------------------------URI--------------------------|
URIs encompass the syntax of both URLs and URNs. It uses a scheme
such as the HTTP protocol to describe how the resource is retrieved. This is followed by a domain
that ends in something like “.com” or “.gov” and may also include a port
number. Then, a file path is described along with any possible query
params and page fragment
s.
Example
Codecademy has a page on Wikipedia, which contains a section about “Features”. The complete URI for this specific resource looks like this:
https://en.wikipedia.org/wiki/Codecademy#Features
The following is used in the example URI:
- A protocol scheme (
https
). - A subdomain (
en
) that specifies the language for the site. - The domain (
wikipedia.org
) containing the “.org” top-level domain. - A directory to Codecademy’s wiki page (
/wiki/Codecademy
). - A fragment (
#Features
) linking to a specific section in the page.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn more on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Career path
Front-End Engineer
Front-end engineers work closely with designers to make websites beautiful, functional, and fast.Includes 34 CoursesWith Professional CertificationBeginner Friendly115 hours