Is an e-mail address a URI?

后端 未结 3 861
陌清茗
陌清茗 2021-02-12 05:42

I\'ve tried to figure out whether the format of an e-mail address can be said to comply with the definition of a URI or not, but I\'ve found no explicit confirmation of this so

3条回答
  •  孤城傲影
    2021-02-12 06:09

    Per RFC 3986:

    A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.

    The basic syntax components as defined by the RFC:

    The generic URI syntax consists of a hierarchical sequence of
    components referred to as the scheme, authority, path, query, and
    fragment.
    
      URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
    
      hier-part   = "//" authority path-abempty
                  / path-absolute
                  / path-rootless
                  / path-empty
    

    So - an e-mail address is not a URI. However mailto:you@server.com is a valid URI.

提交回复
热议问题