gpt4 book ai didi

rest - `STATE TRANSFER`的缩写 `REPRESENTATIONAL STATE TRANSFER`的几个误区

转载 作者:行者123 更新时间:2023-12-03 16:59:44 33 4
gpt4 key购买 nike

所以我对名字有一些误解STATE TRANSFERREPRESENTATIONAL STATE TRANSFER.

  • state transfer意味着传输当前时间实例中服务器中存在的资源的表示?

  • 例子:考虑一个客户要求的当前股价 X company通过点击 /XCompanyPrice company x URI 和当前时间实例在服务器中的股价是 2 美元,这就是所谓的 current state of the resource ,那个资源状态可能会改变是我们能说的吗?这就是 STATE 在首字母缩略词 REPRESENTATIONAL STATE TRANSFER 中的意思。 ?

  • 很少有人说STATE TRANSFER在首字母缩略词REPRESENTATIONAL STATE TRANSFER意味着,when user click on links on a webpage由于 let's say: /about 的信息可能发生变化,应用程序的状态从一个页面更改为另一页面& let's say: /contact页。


  • 很少有人说当客户端访问图像时 let's say by: /image考虑该图像的格式是 BLOB at DB ,但 REST 以可理解的格式将该图像的表示传输给客户端,这只不过是 STATE TRANSFER在首字母缩略词REPRESENTATIONAL STATE TRANSFER.

  • REPRESENTATIONAL STATE TRANSFER. 而言,哪个是正确的
    因此,名称 state transferREPRESENTATIONAL STATE TRANSFER是说the state of the application changes by dataTransferring representations of resource which is there in the server at the current time????
    请帮忙。

    最佳答案

    关于“REST”含义的唯一权威信息来源是 Roy Fielding's dissertation介绍和定义该术语。
    您的问题最简洁的答案可能在 section 5.2.1.2 :

    REST components perform actions on a resource by using a representation to capture the current or intended state of that resource and transferring that representation between components. A representation is a sequence of bytes, plus representation metadata to describe those bytes.... Depending on the message control data, a given representation may indicate the current state of the requested resource, the desired state for the requested resource, or the value of some other resource, such as a representation of the input data within a client's query form, or a representation of some error condition for a response.


    换句话说,组件(如客户端或服务器)通过将其状态的表示传输到另一个组件来对资源进行操作。
    我不完全理解你提到的各种定义和例子,但我会说最后一个基本上是正确的。第二个似乎不正确,因为这里的“状态”清楚地指的是特定资源,而不是模糊的“应用程序状态”。

    关于rest - `STATE TRANSFER`的缩写 `REPRESENTATIONAL STATE TRANSFER`的几个误区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62627848/

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