2013-09-30 2 views
0

Я немного новичок в Google Spreadsheets API Я пытаюсь получить правильные ответы от google, и теперь я застрял в ETag. Дело в том, что я не получаю ETag вообще со стандартным GET запрос так:Нет ETag в Google Spreadsheets Response

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>[email protected]</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 в этом типе ответа!

Но, как вы можете видеть, нет никакого ETag здесь ни в заголовке, ни в узле enrty (gd: etag) Это я или Google, просто изменив схему, не уведомив нас?

p.s. Извините за плохой английский и за помощь заранее

ответ

1

Добавление HTTP-заголовка HTTP «GData-Version: 3.0» к моим запросам решило эту проблему для меня.

Перед добавлением заголовка ни корм, ни элементы ввода не имеют указанного ETag.

В документации указано, что нет необходимости указывать заголовок, поскольку версия 3.0 должна быть по умолчанию, но кажется, что ее отсутствие имеет некоторые побочные эффекты.

+0

Это сработало для меня. Спасибо за эту деталь! – ariestav

Смежные вопросы