URI 是否总是有主机部分

Does a URI always have a host part

必须具有 authority 部分的 strictly valid URI(您将用作 URL 以访问远程资源的那种)始终具有主机部分?

也就是AMQP connection "URI"amqp://

是的,有效的 URI 总是有主机部分,尽管它可能是零长度。

Quoth标准:

If the URI scheme defines a default for host, then that default applies when the host subcomponent is undefined or when the registered name is empty (zero length).

然后标准指出 file 方案的默认主机是本地主机,但 http 方案没有默认主机,因此 host 该方案的部分必须是非空的。