好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

浅析什么是uriAnalysis of what is URI.doc

11页
  • 卖家[上传人]:ss****gk
  • 文档编号:205607192
  • 上传时间:2021-10-29
  • 文档格式:DOC
  • 文档大小:74KB
  • / 11 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 浅析什么是 uri (Analysis of what is URI)Analysis of what is URI?Analysis of what is URI?Analysis of what is URI?1. what is URI?Each resource available on Web 一 HTML documents, images, video clips, programs, etc. - by one passUse the Universal Resource Identifier (URI) for location.URI generally consists of three parts:The naming mechanism for accessing resources.The host name of the resource to be stored.The name of the resource itself, represented by the path.Uri represents the data to be operated, and Uri mainly contains two parts of information: 1. , the ContentProvider that needs to be operated, and 2. what is the data in the Contentprovider. A Uri consists of the following parts:The 1. scheme:ContentProvider of the content provider (scheme) has been defined by Android as: content://.2. host name (or Authority): used to uniquely identify the ContentProvider, and the external caller can find it based on the identity.3. path (path) : can be used to indicate the data we want to operate, the path should be built according to the business, as follows:To operate a record of ID 10 in the contact table, you can build this path: /contact/10To operate the name field of the record ID of 10 in the contact table, contact/10/nameTo operate all the records in the contact table, you can build this path: /contactThe data to be operated does not necessarily come from the database or the file, but he stores it as follows:To operate the name node under the contact node in the XML file, you can build this path: /contact/nameIf you want to convert a string to Uri, you can use the parse ()method in the Uri class as follows:Uri URI = Uri. parse("content://com・ changcheng. provider, contactprovider/contact 〃)Consider the following URI, which represents the current HTML 4 specification:Http://www・ webmonkey, com. cn/html/html40/The URI is like this: This is a resource that can be accessed through the HTTP protocol, located in the mainOn machine ^vw. webmonkey, com. cn, access via path ,,/html/html40/,. In the HTML documentOther resources include 〃mailto〃 (send and receive email) and 〃Ftp〃 (FTP access).This is another example of URI, pointing to a users mailbox:mailto: joe@someplace. com/z, 〃〉Joe Cool〈/A>〃Note: most readers may be familiar with 〃URL〃 instead of 〃URI〃・ URL is a subset of the URI naming mechanism.Fragment identifierSome URI point to the interior of a resource. The URI 〃#〃 end, and with a anchor logoCharacters (called fragment identifiers). For example, here is a URI that points to section 2:Http://somesite. com/html/top. htmttsection 2Relative URI does not contain any naming specification information. Its path usually refers to the resources on the same machine. Relative UR I may contain relative paths, such as 〃.・.〃 that represent the upper layer path) and may contain fragment TagsSymbol.To illustrate the relative URI, suppose we have a basic URI http://www. acme, com/support/intro, htmThe relative URI is used in the following link:SuppliersIt expands into full URI, that is, 〃http://www・ acme, com/support/suppliers. htm〃〃,The following is the relative URI of an image:It expands into full URI, that is, 〃http://www・ acme, com/icons/logo. gif〃〃・In HTML, URI is used:Link to another document or resource (see A and LINK elements).Link to an external style sheet or script (see LINK and SCRIPT elements).Include images, objects, or applet in the page (see I MAG, OBJECT, APPLET, and INPUT)Element).Create image mappings (see MAP and AREA elements).Submit a form (see FORM).Create a framework document (see FRAME and IFRAME elements).Refer to an external reference (see Q, BLOCKQUOTE, INS, and DEL elements).Point to the metadata for a description document (see the HEAD element).2. what is URL?:URL is the abbreviation of Uniform ResourceLocation, which is used as the uniform resource locator”. Popularly speaking, URL is a string used to describe information resources on Internet, mainly used in various WWW client programs and server programs, especially the famous Mosaic. URL can be used in a unified format to describe all kinds of information resources, including files, servers, addresses and directories.URL formatThe format of URL consists of the following three parts:The first part is agreement (or service);The second part is the host IP address that contains the resource (sometimes including port numbers);The third part is the specific address of the host resource. Such as directories and filenames.Between the first part and the second part 〃: / / symbols separated from the second part and the third part" / "sign off. The first and second parts are indispensable, and the third part can sometimes be omitted.URL exampleFile URL:When a file is represented in URL, the server is represented in file, followed 。

      点击阅读更多内容
      猜您喜欢
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.