gpt4 book ai didi

http - URL 路径段中的参数

转载 作者:可可西里 更新时间:2023-11-01 17:06:23 26 4
gpt4 key购买 nike

URL格式有一件有趣的事:
URL 路径段中的参数。

有关详细信息,请参阅
中的“2.2.5”部分“O'Reilly - HTTP - 权威指南”。

这本书可以在网上免费找到。

或在官方规范中 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 的路径部分。

  1. first-segment 是该路径的第一段
  2. second-segment 是该路径的第二段
  3. index.html 是该路径的第三段

在那本书中指出,每个段都可以有单独的参数,用分号“;”分隔。在我们的示例中,它可能是:

http://www.example.com/first-segment;f1=WWW/second-segment;s1=1;s2=2/index.html;i1=100;abc=200?type=HelloWorld
  1. 此处 f1 - first-segment 的参数
  2. s1s2 - second-segment
  3. 的参数
  4. i1abc 参数用于 index.html

问题是:您知道 URL 中此类参数的任何实际示例吗?

最佳答案

我不知道路径段中确切参数的任何示例。

但最接近的例子是(过期)SFTP URL proposal 中的连接和 SFTP 参数.

有人提议 connection parameter ,SSH主机 key 指纹的指纹:

sftp://username:password;fingerprint=ssh-dss-0b-77-...@example.com/

还有一个提议SFTP parameter ,传输模式的 typecode(ascii 与二进制)。没有官方的例子,但应该是这样的:

sftp://username:password@example.com/path/file;typecode=i

(实际上,虽然在语义上有所不同,但具有您的“路径”参数的语法)

关于http - URL 路径段中的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40440004/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com