Google 日历 API - ETag 的值应该是多少?

Google Calendar API - What should be value for ETag?

根据documentation

The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed. Additionally, etags help to prevent simultaneous updates of a resource from overwriting each other.

我正在尝试使用 Google 日历 API 在事件中添加 ETag,但不清楚用法,

许多 Google 日历对象的响应中返回的 Etag 只是服务器上次更改响应中的数据时创建的标识符。

因此,如果您进行 event.get 调用并返回一个包含 etag 的事件对象。下次您进行该调用时,您将再次获得一个包含 etag 的事件对象。如果 etag 与您之前的 etag 相同,那么您就知道自上次检查以来数据没有更改。

话虽如此,您并未创建电子标签。只有服务器可以。您也无法写入 Etag。如果你检查 calendar object 你会发现 description is writeable etag 不是。因此,如果您尝试插入一个新日历并为 Etag 发送一个值,您将收到一个错误。