URI中遵循该方案的双斜杠的含义是什么? [英] What is the semantics of the double slash following the scheme in a URI?

查看:196
本文介绍了URI中遵循该方案的双斜杠的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 http://tools.ietf.org/html/rfc3986 http://en.wikipedia.org/wiki/Uniform_resource_identifier ,URI可能包含也可能不包含双精度方案标识符后面的斜线.就像"http://stackoverflow.com"一样,这使"urn:issn:1535-3613"成为有效的URI.

According to http://tools.ietf.org/html/rfc3986 and http://en.wikipedia.org/wiki/Uniform_resource_identifier, a URI may or may not contain a double slash following the scheme identifier. This makes "urn:issn:1535-3613" a valid URI just as "http://stackoverflow.com".

是否有严格/正式的要求包含双斜杠,或者它是可选的,在任何情况下,其原因/语义是什么?回答时,请提供结论性的答案-不要只报告您的浏览器/库/...如何处理它.

Is there a strict/formal need to include the double slash or is it optional and in any case, what is the reason/semantics? When answering, please provide a conclusive answer - Don't just report how you browser/library/... handles it.

推荐答案

它在您链接的RFC中:如果存在//,则表示紧随其后的是 authority .请参见第3部分.因此,如果该方案使用 authority ,它将在冒号后使用//(或者要求使用,如果该方案中要求 authority 或可选)如果在该方案中 authority 是可选的). mailto在URI的意义上不使用 authority ,因此mailto URI不包含//.

It's in the RFC you linked: If there is a //, it means that what follows that is the authority. See Section 3. So if the scheme uses an authority, it will use the // after the colon (either requiring it, if authority is required in that scheme, or having it be optional if authority is optional in that scheme). mailto doesn't use an authority in the URI sense, so mailto URIs don't include a //.

这篇关于URI中遵循该方案的双斜杠的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆