gpt4 book ai didi

http - URL "scheme plus authority"的正式名称

转载 作者:可可西里 更新时间:2023-11-01 15:07:34 24 4
gpt4 key购买 nike

假设一个绝对的 http 或 https URL。我正在为路径之前的 URL 部分寻找“官方”或普遍接受的名称。

    http://foo:bar@example.com:8042/over/there?name=ferret#nose
\_____________________________/
|
this part

RFC 3986定义 URL 语法部分如下:

    http://foo:bar@example.com:8042/over/there?name=ferret#nose
\__/ \______________________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment

RFC 6454将 URL 的来源(如“同源”)定义为三元组(方案、主机、端口):

    http://foo:bar@example.com:8042/over/there?name=ferret#nose
\__/ \______________/
\________________/
|
origin

因此,这两个术语都不合适。我正在查看的部分是否有合适的术语,或者我是否坚持使用“方案(加 ://)加权限”?

最佳答案

实践中的名称和 current URL standard因为路径之前的 URL 部分实际上只是 origin

URL 的 :// 部分只是句法(或词法?)产物,在讨论使用或处理 URL 的任何事物的实际行为(其他当然比低级解析器)。

用户名-密码部分是一个不合规的错误功能,现在只能作为历史错误进行讨论。 relevant part of the current URL standard对此有话要说;

There is no conforming way to express a username or password of a URL record within a URL string.

因此,在实践中,对于与当前标准定义 URL 的方式一致的 URL 的任何正常讨论,仅根据其最高级别的部分只有四个部分来谈论 URL 就足够了:它的来源、它的路径、它的查询(部分)和它的片段(部分)。

当然这至少是 current URL standard 的内容本身将其限制为。

关于http - URL "scheme plus authority"的正式名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32656791/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com