【问题标题】:No ETag in Google Spreadsheets ResponseGoogle 电子表格响应中没有 ETag
【发布时间】:2013-10-06 07:45:32
【问题描述】:

我对 Google 电子表格 API 有点陌生 我试图从谷歌得到正确的回应,现在我被 ETag 困住了。 事实是,像这样的标准 GET 查询我根本没有得到任何 ETag:

https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full/

回复是:

<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"
xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
<id>
https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full
</id>
<updated>2013-09-30T11:39:01.088Z</updated>
<category scheme="http://schemas.google.com/spreadsheets/2006"     term="http://schemas.google.com/spreadsheets/2006#list"/>
<title type="text">Sheet1</title>
<link rel="alternate" type="text/html" href="https://spreadsheets.google.com/ccc?key=tCOhygAeHDCgliY3E8uONNA"/>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full"/>
<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full"/>
<link rel="self" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full"/>
<author>
<name>promo</name>
<email>promo@balderbetter.com</email>
</author>
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<entry>
<id>
https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full/cokwr
</id>
<updated>2013-09-30T11:39:01.088Z</updated>
<category scheme="http://schemas.google.com/spreadsheets/2006" term="http://schemas.google.com/spreadsheets/2006#list"/>
<title type="text">Value 1</title>
<content type="text">header2: Value 2</content>
<link rel="self" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full/cokwr"/>
<link rel="edit" type="application/atom+xml" href="https://spreadsheets.google.com/feeds/list/tCOhygAeHDCgliY3E8uONNA/od6/private/full/cokwr/1jlaa31hglf"/>
<gsx:header1>Value 1</gsx:header1>
<gsx:header2>Value 2</gsx:header2>
</entry>
</feed>

我在这里转给https://developers.google.com/google-apps/spreadsheets/?hl=ru#retrieving_a_list-based_feed 在这种类型的响应中显示 ETag 存在!

但是正如你所见,无论是在标头中还是在 enrty 节点中 (gd:etag) 中都没有任何 ETag 是我还是 Google 只是在没有通知我们的情况下更改了架构?

附言抱歉英语不好,提前感谢您的帮助

【问题讨论】:

    标签: xml google-sheets google-spreadsheet-api etag


    【解决方案1】:

    在我的请求中添加 HTTP 标头“GData-Version: 3.0” 为我解决了这个问题。

    在添加标题之前,提要和条目元素都没有指定的 ETag。

    文档声明没有必要指定标头,因为版本 3.0 应该是默认值,但似乎省略它确实有一些副作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多