@ 在没有编码的 url 中的用途

purpose of @ in urls without encoding

据我所知

following symbols are reserved and can't be used without encoding in url.
* ' ( ) ; : @ & = + $ , / ? % # [ ]

在 url 中 @without 编码的真正目的是什么? 如何使用?

根据RFC2396,这是一个“保留字符”:

[ ... ] their usage within the URI component is limited to their reserved purpose. If the data for a URI component would conflict with the reserved purpose, then the conflicting data must be escaped before forming the URI.

虽然没有什么阻止它被使用,只要它的使用不与预期目的冲突:

The "reserved" syntax class above refers to those characters that are allowed within a URI, but which may not be allowed within a particular component of the generic URI syntax; they are used as delimiters of the components described in Section 3.

第 3 节指出:

The authority component is preceded by a double slash "//" and is terminated by the next slash "/", question-mark "?", or by the end of the URI. Within the authority component, the characters ";", ":", "@", "?", and "/" are reserved.

所以 @ 符号是有效的,只要没有查询字符串。

@ 也适用于 mailto 协议,并通过基于 IP 的协议 (<userinfo>@<host>:<port>) 直接连接到指定的服务器,但如果不是,则可以省略使用用户信息:

The parts "@" and ":" may be omitted.
server = [ [ userinfo "@" ] hostport ]