【问题标题】:Is there a term in REST vocabulary describing the HTTP server?REST 词汇表中有描述 HTTP 服务器的术语吗?
【发布时间】:2013-04-10 09:47:24
【问题描述】:

考虑到这些 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 的术语来表示这一点?还是这只是一种特殊的“容器”?

【问题讨论】:

    标签: url rest vocabulary


    【解决方案1】:

    来自Uniform Resource Identifier standard (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's dissertation 似乎表明他使用了相同的术语,这并不奇怪,因为他也是 RFC3986 的作者之一。 ;-)

    【讨论】:

      【解决方案2】:

      REST 是独立于 HTTP 的架构风格。另一方面,REST 是可以部分应用于 HTTP 的架构风格。注意区别:HTTP 是协议,REST 是架构风格。所以你无法在 Roy 的论文中找到答案,但你可以使用 URI RFC 引入的术语,我会推荐这个。

      【讨论】:

        猜你喜欢
        • 2019-06-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-28
        • 2010-10-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多