考虑这些 REST 资源:
http://foo:123/bar/baz
http://foo:123/bar/boz
http://foo:123/bar/buz
http://nirwana:99/abc
http://nirwana:99/def
资源组 1 到 3 以及 4 和 5 共享相同的网络端点(主机和端口)。是否有特定于 REST 的术语来表示这一点?或者这只是一种特殊的“容器”?
考虑这些 REST 资源:
http://foo:123/bar/baz
http://foo:123/bar/boz
http://foo:123/bar/buz
http://nirwana:99/abc
http://nirwana:99/def
资源组 1 到 3 以及 4 和 5 共享相同的网络端点(主机和端口)。是否有特定于 REST 的术语来表示这一点?或者这只是一种特殊的“容器”?
来自统一资源标识符标准 (RFC3986)第 3 节...
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
[...]
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose
...所以他们使用“权威”一词。
快速浏览一下最初定义 REST 概念的Roy Fielding 的论文似乎表明他使用了相同的术语,这并不奇怪,因为他也是 RFC3986 的作者之一。;-)
REST 是独立于 HTTP 的架构风格。另一方面,REST 是可以部分应用于 HTTP 的架构风格。注意区别:HTTP 是协议,REST 是架构风格。所以你无法在 Roy 的论文中找到答案,但你可以使用 URI RFC 引入的术语,我会推荐这个。