URL路径段中的参数

时间:2016-11-05 15:34:39

标签: http url https ftp ftps

网址格式有一个有趣的事情:
URL路径段中的参数。

有关详细信息,请参阅" 2.2.5"在
" O' Reilly - HTTP - 权威指南"。

或在官方规范中 https://www.ietf.org/rfc/rfc2396.txt 第3.3节。

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

让我们考虑以下网址:

http://www.example.com/first-segment/second-segment/index.html?type=HelloWorld

此处/first-segment/second-segment/index.html是网址的路径部分。

  1. first-segment是该路径的第一段
  2. second-segment是该路径的第二段
  3. index.html是该路径的第三段
  4. 在该书中指出,每个段可以具有由分号";"分隔的各个参数。在我们的例子中,它可能是:

    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. 的参数
    3. s1s2 - second-segment
    4. 的参数 {li> i1abcindex.html参数

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

1 个答案:

答案 0 :(得分:1)

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

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

有一个建议的connection parameterfingerprint用于SSH主机密钥指纹:

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

一个提议SFTP parametertypecode用于传输模式(ascii与二进制)。没有官方的例子,但它应该是:

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

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