language-agnostic - URL 中特定保留字符背后的基本原理是什么?

标签 language-agnostic

我注意到这些字符都是非法的

#%<>?\/*+|:"

我注意到这些是编码的(%NN,其中 NN 是十六进制值)但可以毫无问题地替换
$,;=& @

(注意通常编码为 + 的空格(但可能是 %20))
#%?/+我明白。但是以下字符有什么作用呢? <>\*|":
注:我懂什么:在域部分(它的端口)中,@ 是一个登录名,但在第一个/为什么之后:非法? (@不是)

最佳答案

RFC 2396 (Uniform Resource Identifiers URI: Generic Syntax)说:

Many URI include components consisting of or delimited by, certain special characters. These characters are called "reserved", since their usage within the URI component is limited to their reserved purpose.


reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
              "$" | ","

2.4.3. Excluded US-ASCII Characters

The angle-bracket "<" and ">" and double-quote (") characters are excluded because they are often used as the delimiters around URI in text documents and protocol fields. The character "#" is excluded because it is used to delimit a URI from a fragment identifier in URI references (Section 4). The percent character "%" is excluded because it is used for the encoding of escaped characters.


delims      = "<" | ">" | "#" | "%" | <">

Other characters are excluded because gateways and other transport agents are known to sometimes modify such characters, or they are used as delimiters.


unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

我认为这涵盖了你提到的所有内容。星号“*”不是保留的,可以使用。将此粘贴到浏览器中:http://en.wikipedia.org/wiki/ *

关于language-agnostic - URL 中特定保留字符背后的基本原理是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4581307/

相关文章:

language-agnostic - 二进制文件布局引用

design-patterns - DAO 是否负责向 'join' 表中插入记录

algorithm - 将数字四舍五入为不对称分辨率

language-agnostic - 您为自定义 IDE 做了哪些工作?

winforms - 使遗留的简单 win.forms 应用程序代码更加清晰

使用缩放图 block 最大化矩形区域覆盖的算法

language-agnostic - 魔数(Magic Number)与命名常量

design-patterns - 中介者模式或责任过多

language-agnostic - 您是否曾经限制自己只使用语言功能的子集?

database - 存储映射 "key -> event stream"的最有效方法是什么?