【问题标题】:Does the @ (at) symbol need to be encoded in a URL path?@ (at) 符号是否需要在 URL 路径中编码?
【发布时间】:2014-04-10 21:57:01
【问题描述】:

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

https://example.com/User/test@example.com

Precent-encoded,它将是https://example.com/User/test%40example.com,人类不可读。

两者似乎都适用于主要浏览器 - 想知道是否存在会导致问题的情况。

【问题讨论】:

    标签: http url url-encoding


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-13
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      • 1970-01-01
      • 2012-11-22
      • 2013-12-05
      相关资源
      最近更新 更多