网页
综合
更新时间 2005-01-25 00:00:00
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax | RFC Editor
自动蜘蛛
www.rfc-editor.org
正文约 6000 字
Skip to content Primary navigationThe RFC SeriesFor AuthorsAbout UsHomeRFC 3986 View as: Plain Text, Compact HTML Info RFC 3986: STD 66: Uniform Resource Identifier (URI): Generic SyntaxURIJanuary 2005. T. Berners-Lee, R. Fielding, L. MasinterInternet StandardSubscribe14 subscribed Add to Set Added to 15 Sets Read aloud This RFC was updated, see RFC 7320, RFC 8820.Network Working Group T. Berners-Lee Request for Comments: 3986 W3C/MIT STD: 66 R. Fielding Updates: 1738 Day Software Obsoletes: 2732, 2396, 1808 L. Masinter Category: Standards Track Adobe Systems January 2005 Uniform Resource Identifier (URI): Generic Syntax Status of This Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. Copyright Notice Copyright (C) The Internet Society (2005). Abstract A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme. Berners-Lee, et al. Standards Track [Page 1] RFC 3986 URI Generic Syntax January 2005 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1. Overview of URIs . . . . . . . . . . . . . . . . . . . . 4 1.1.1. Generic Syntax . . . . . . . . . . . . . . . . . 6 1.1.2. Examples . . . . . . . . . . . . . . . . . . . . 7 1.1.3. URI, URL, and URN . . . . . . . . . . . . . . . 7 1.2. Design Considerations . . . . . . . . . . . . . . . . . 8 1.2.1. Transcription . . . . . . . . . . . . . . . . . 8 1.2.2. Separating Identification from Interaction . . . 9 1.2.3. Hierarchical Identifiers . . . . . . . . . . . . 10 1.3. Syntax Notation . . . . . . . . . . . . . . . . . . . . 11 2. Characters . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1. Percent-Encoding . . . . . . . . . . . . . . . . . . . . 12 2.2. Reserved Characters . . . . . . . . . . . . . . . . . . 12 2.3. Unreserved Characters . . . . . . . . . . . . . . . . . 13 2.4. When to Encode or Decode . . . . . . . . . . . . . . . . 14 2.5. Identifying Data . . . . . . . . . . . . . . . . . . . . 14 3. Syntax Components . . . . . . . . . . . . . . . . . . . . . . 16 3.1. Scheme . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2. Authority . . . . . . . . . . . . . . . . . . . . . . . 17 3.2.1. User Information . . . . . . . . . . . . . . . . 18 3.2.2. Host . . . . . . . . . . . . . . . . . . . . . . 18 3.2.3. Port . . . . . . . . . . . . . . . . . . . . . . 22 3.3. Path . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.4. Query . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.5. Fragment . . . . . . . . . . . . . . . . . . . . . . . . 24 4. Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.1. URI Reference . . . . . . . . . . . . . . . . . . . . . 25 4.2. Relative Reference . . . . . . . . . . . . . . . . . . . 26 4.3. Absolute URI . . . . . . . . . . . . . . . . . . . . . . 27 4.4. Same-Document Reference . . . . . . . . . . . . . . . . 27 4.5. Suffix Reference . . . . . . . . . . . . . . . . . . . . 27 5. Reference Resolution . . . . . . . . . . . . . . . . . . . . . 28 5.1. Establishing a Base URI . . . . . . . . . . . . . . . . 28 5.1.1. Base URI Embedded in Content . . . . . . . . . . 29 5.1.2. Base URI from the Encapsulating Entity . . . . . 29 5.1.3. Base URI from the Retrieval URI . . . . . . . . 30 5.1.4. Default Base URI . . . . . . . . . . . . . . . . 30 5.2. Relative Resolution . . . . . . . . . . . . . . . . . . 30 5.2.1. Pre-parse the Base URI . . . . . . . . . . . . . 31 5.2.2. Transform References . . . . . . . . . . . . . . 31 5.2.3. Merge Paths . . . . . . . . . . . . . . . . . . 32 5.2.4. Remove Dot Segments . . . . . . . . . . . . . . 33 5.3. Component Recomposition . . . . . . . . . . . . . . . . 35 5.4. Reference Resolution Examples . . . . . . . . . . . . . 35 5.4.1. Normal Examples . . . . . . . . . . . . . . . . 36 5.4.2. Abnormal Examples . . . . . . . . . . . . . . . 36 Berners-Lee, et al. Standards Track [Page 2] RFC 3986 URI Generic Syntax January 2005 6. Normalization and Comparison . . . . . . . . . . . . . . . . . 38 6.1. Equivalence . . . . . . . . . . . . . . . . . . . . . . 38 6.2. Comparison Ladder . . . . . . . . . . . . . . . . . . . 39 6.2.1. Simple String Comparison . . . . . . . . . . . . 39 6.2.2. Syntax-Based Normalization . . . . . . . . . . . 40 6.2.3. Scheme-Based Normalization . . . . . . . . . . . 41 6.2.4. Protocol-Based Normalization . . . . . . . . . . 42 7. Security Considerations . . . . . . . . . . . . . . . . . . . 43 7.1. Reliability and Consistency . . . . . . . . . . . . . . 43 7.2. Malicious Construction . . . . . . . . . . . . . . . . . 43 7.3. Back-End Transcoding . . . . . . . . . . . . . . . . . . 44 7.4. Rare IP Address Formats . . . . . . . . . . . . . . . . 45 7.5. Sensitive Information . . . . . . . . . . . . . . . . . 45 7.6. Semantic Attacks . . . . . . . . . . . . . . . . . . . . 45 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 46 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 46 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 46 10.1. Normative References . . . . . . . . . . . . . . . . . . 46 10.2. Informative Referen
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。