Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 每个URI的预期用途是什么;保留字符“;?_Url_Character Encoding_Uri_Url Encoding - Fatal编程技术网

Url 每个URI的预期用途是什么;保留字符“;?

Url 每个URI的预期用途是什么;保留字符“;?,url,character-encoding,uri,url-encoding,Url,Character Encoding,Uri,Url Encoding,我们总是在URL中看到保留字符,如/,#,&;但是像@,[,],,,这样不太常见的代码的预期用途是什么呢 我还没能找到一个很好的解释来解释这些字符是用来做什么的 请参阅和。@用于向url添加用户名和密码,因此您可以执行http://username:password@host.com @和::用于主机的HTTP登录数据(http://john:password@example.com) :还将主机与端口分开(http://example.com:1337) 请注意,@显然用于mailtouri

我们总是在URL中看到保留字符,如
/
#
&
;但是像
@
[
]
这样不太常见的代码的预期用途是什么呢

我还没能找到一个很好的解释来解释这些字符是用来做什么的


请参阅和。

@用于向url添加用户名和密码,因此您可以执行
http://username:password@host.com

  • @
    :用于主机的HTTP登录数据(
    http://john:password@example.com
    • 还将主机与端口分开(
      http://example.com:1337
    • 请注意,
      @
      显然用于
      mailto
      uri的路径中,但是
  • [
    ]
    :for(
    [db:resource/Albert\u Einstein]
  • :可用于限定(查询)参数
  • :请参见此问题:

关于其余部分的推测:他们希望在以后使用此协议和其他协议时,即使没有考虑特定用途,也要谨慎地删除字符。RFC说
+
$
是为查询字符串保留的,但没有指定用途。我见过Broser能毫无意外地处理这些角色。