http - @(at) 符号是否需要编码在 URL 路径中?

标签 http url url-encoding

可以在这样的 URL 路径中使用未编码的 @/at 符号吗?

https://example.com/User/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1b5a4b2b581a4b9a0acb1ada4efa2aeac" rel="noreferrer noopener nofollow">[email protected]</a>

预编码,它将是 https://example.com/User/test%40example.com ,人类可读性较差。

似乎都可以在主要浏览器中工作 - 想知道是否存在会导致问题的情况。

最佳答案

查看 RFC 3986 中的“pchar”ABNF 规则 ( http://greenbytes.de/tech/webdav/rfc3986.html#path ):

pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"

所以,是的,“@”是允许的,不需要转义。

关于http - @(at) 符号是否需要编码在 URL 路径中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22999841/

相关文章:

javascript - 将curl选项传递给node js http请求

javascript - Angular 工厂方法不是函数(dataFactory.addContact 不是函数)

python http网络服务器

javascript - 如何在 html div 中加载 url?该 url 可能是公共(public)域或使用 html、javascript 的本地 Web 应用程序 url

azure - 强制 HTTPS 连接到 Azure Blob 存储

python - 使用python正确编码文件路径

apache - Apache 可以处理 URL 中的 +(加号)空格吗?

iphone - 从我的应用程序中启动时,字符被邮件应用程序切断

ruby-on-rails - Google Geocoding API request_denied

python - Django 模板不存在