What Type of Data Is URI?

//

Scott Campbell

What Type of Data Is URI?

A Uniform Resource Identifier (URI) is a string of characters that identifies a resource on the internet. It can be used to locate, retrieve, or interact with the resource. URIs can represent various types of data, each serving a different purpose.

1. Uniform Resource Locator (URL)

URL is the most common type of URI. It specifies the location of a resource on the web and provides instructions on how to access it. URLs consist of several components, including the protocol (e.g., HTTP or HTTPS), domain name, path, and query parameters.

For example: https://www.example.com/index.html?search=URIs

  • Protocol: The protocol used to transfer data between the client and server.
  • Domain Name: The unique identifier for a website.
  • Path: The specific location within the website’s file structure.
  • Query Parameters: Additional information passed to the server for processing.

2. Uniform Resource Name (URN)

URN is another type of URI that provides a persistent identifier for a resource even if its location changes over time. URNs are typically used to identify resources that are not necessarily accessible via the internet but still require long-term identification.

For example: urn:isbn:978-3-16-148410-0

URNs can be used to uniquely identify books, articles, or other resources irrespective of their current location or availability.

3. Data URI Scheme

Data URIs allow you to embed data directly into a web page using inline data. This means that instead of referencing an external resource, you can include the data directly within the URI itself. Data URIs are often used for embedding small images or other resources that don’t require separate HTTP requests.

For example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..

Data URIs consist of a MIME type (e., image/png) followed by a base64-encoded string representing the data.

4. Fragment Identifier

A fragment identifier is used to identify a specific section within an HTML document. It is denoted by the ‘#’ character followed by the ID or name of the Target element. Fragment identifiers are commonly used to link to specific sections within a webpage.com/about#section2

In this case, clicking on the link will scroll the page to the element with the ID “section2.”

Conclusion

URI encompasses various types of data, including URLs, URNs, data URIs, and fragment identifiers. Each type serves a different purpose and allows for different ways of identifying and accessing resources on the internet. Understanding these different types can help developers work with different kinds of data effectively.

Discord Server - Web Server - Private Server - DNS Server - Object-Oriented Programming - Scripting - Data Types - Data Structures

Privacy Policy