Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference and relationship between uri and url

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

What is the difference and relationship between uri and url? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

URI, is uniform resource identifier, uniform resource identifier, used to uniquely identify a resource.

Every kind of resource available on Web, such as HTML documents, images, video clips, programs, etc., is generally composed of three parts: the naming mechanism of ① accessing resources, the naming mechanism of ② to store resources, and the name of ③ resources themselves, represented by paths, with emphasis on resources.

URL is a uniform resource locator, uniform resource locator, it is a specific URI, that is, URL can be used to identify a resource, but also indicates how to locate the resource.

URL is a string used to describe information resources on Internet. It is mainly used in various WWW client programs and server programs, especially the famous Mosaic. URL can be used to describe a variety of information resources, including files, server addresses and directories, in a unified format. URL generally consists of three parts: the ① protocol (or service mode) ② stores the host IP address (and sometimes the port number) of the resource, and the specific address of the ③ host resource. Such as directory and file name

URN,uniform resource name, uniform resource naming, identifies resources by name, such as mailto:java-net@java.sun.com.

URI is an abstract, high-level concept to define a unified resource identification, while URL and URN are specific ways of resource identification. Both URL and URN are URI. Generally speaking, every URL is a URI, but not necessarily every URI is a URL. This is because URI also includes a subclass, uniform Resource name (URN), which names resources but does not specify how to locate them. The mailto, news, and isbn URI above are all examples of URN.

In Java's URI, an URI instance can represent either absolute or relative, as long as it conforms to the syntax rules of URI. The URL class is not only semantic, but also contains information to locate the resource, so it cannot be relative. In the Java class library, the URI class does not contain any methods to access resources, and its only function is to parse. Instead, the URL class can open a stream to the resource.

This is the answer to the question about the difference and connection between uri and url. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report