URL 路径段中的参数
Parameters in Path Segments of URL
URL格式有一件有趣的事:
URL.
路径段中的参数
有关详细信息,请参阅
中的“2.2.5”部分
“O'Reilly - HTTP - 权威指南”。
这本书可以在 Internet 上免费找到。
或者在官方规范中
https://www.ietf.org/rfc/rfc2396.txt
第 3.3 节
3.3. Path Component
The path component contains data, specific to the authority (or the
scheme if there is no authority component), identifying the resource
within the scope of that scheme and authority.
path = [ abs_path | opaque_part ]
path_segments = segment *( "/" segment )
segment = *pchar *( ";" param )
param = *pchar
pchar = unreserved | escaped |
":" | "@" | "&" | "=" | "+" | "$" | ","
让我们考虑以下 URL:
http://www.example.com/first-segment/second-segment/index.html?type=HelloWorld
这里/first-segment/second-segment/index.html
是URL的Path部分。
- 并且
first-segment
是该路径的第一段
second-segment
是该路径的第二段
index.html
是该路径的第三段
那本书中说每个段可以有单独的参数,用分号“;”分隔。在我们的示例中,它可能是:
http://www.example.com/first-segment;f1=WWW/second-segment;s1=1;s2=2/index.html;i1=100;abc=200?type=HelloWorld
- 此处
f1
- first-segment
的参数
s1
和 s2
- second-segment
的参数
i1
和 abc
参数 index.html
问题是:您知道 URL 中此类参数的任何实际示例吗?
我不知道路径段中确切参数的任何示例。
但最接近的例子是连接和 SFTP 参数(已过期)SFTP URL proposal。
有人提议 connection parameter,SSH 主机密钥指纹 fingerprint
:
sftp://username:password;fingerprint=ssh-dss-0b-77-...@example.com/
有人提出 SFTP parameter,typecode
用于传输模式(ascii 与二进制)。没有官方的例子,但应该是这样的:
sftp://username:password@example.com/path/file;typecode=i
(实际上,虽然在语义上有所不同,但具有您的“路径”参数的语法)
URL格式有一件有趣的事:
URL.
有关详细信息,请参阅
中的“2.2.5”部分
“O'Reilly - HTTP - 权威指南”。
这本书可以在 Internet 上免费找到。
或者在官方规范中 https://www.ietf.org/rfc/rfc2396.txt 第 3.3 节
3.3. Path Component
The path component contains data, specific to the authority (or the scheme if there is no authority component), identifying the resource
within the scope of that scheme and authority.path = [ abs_path | opaque_part ] path_segments = segment *( "/" segment ) segment = *pchar *( ";" param ) param = *pchar pchar = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | ","
让我们考虑以下 URL:
http://www.example.com/first-segment/second-segment/index.html?type=HelloWorld
这里/first-segment/second-segment/index.html
是URL的Path部分。
- 并且
first-segment
是该路径的第一段 second-segment
是该路径的第二段index.html
是该路径的第三段
那本书中说每个段可以有单独的参数,用分号“;”分隔。在我们的示例中,它可能是:
http://www.example.com/first-segment;f1=WWW/second-segment;s1=1;s2=2/index.html;i1=100;abc=200?type=HelloWorld
- 此处
f1
-first-segment
的参数
s1
和s2
-second-segment
的参数
i1
和abc
参数index.html
问题是:您知道 URL 中此类参数的任何实际示例吗?
我不知道路径段中确切参数的任何示例。
但最接近的例子是连接和 SFTP 参数(已过期)SFTP URL proposal。
有人提议 connection parameter,SSH 主机密钥指纹 fingerprint
:
sftp://username:password;fingerprint=ssh-dss-0b-77-...@example.com/
有人提出 SFTP parameter,typecode
用于传输模式(ascii 与二进制)。没有官方的例子,但应该是这样的:
sftp://username:password@example.com/path/file;typecode=i
(实际上,虽然在语义上有所不同,但具有您的“路径”参数的语法)