Retrieving Updated Contact Photo ETag

62 views
Skip to first unread message

Donald

unread,
Dec 24, 2012, 4:59:01 AM12/24/12
to gdata-objec...@googlegroups.com
Upon completing an upload of a new contact photo, I'd like to be able to have access to a contact's new ETag identifier for the photo.  However, I'm finding that the response header only provides the previous ETag.  This is insufficient for my needs as I'd like to be able to detect when the Google photo changes later on by comparing the current ETag for the contact's photo to the previous one that I stored off.  Is there a way to get the new ETag in the response header?

Here's the response header for my test:

2012-12-24 09:37:44 +0000
Request headers:
  Accept: application/atom+xml, text/xml
  Authorization: GoogleLogin auth=_snip_
  Cache-Control: no-cache
  Content-Length: 25962
  Content-Type: image/jpeg
  GData-Version: 3.0
  If-Match: "LyxrbgohfCt7I2BJWEEIGApJEgEaH1wMbDc."
  Mime-Version: 1.0
  User-Agent: GData-ObjectiveC/1.12 iPhone/6.0.1 (gzip)

Request body: (25962 bytes)
<<25962 bytes>>

Response: status 200
Response headers:
  Cache-Control: private, max-age=0
  Content-Encoding: gzip
  Content-Type: application/atom+xml; charset=UTF-8; type=entry
  Date: Mon, 24 Dec 2012 09:37:44 GMT
  Etag: "LyxrbgohfCt7I2BJWEEIGApJEgEaH1wMbDc."
  Expires: Mon, 24 Dec 2012 09:37:44 GMT
  GData-Version: 3.1
  Server: GSE
  Transfer-Encoding: Identity
  X-Content-Type-Options: nosniff
  X-Frame-Options: SAMEORIGIN
  X-XSS-Protection: 1; mode=block

Response body: (700 bytes)
<?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='&quot;LyxrbgohfCt7I2BJWEEIGApJEgEaH1wMbDc.&quot;'><id>http://www.google.com/m8/feeds/photos/media/xyz%40gmail.com/63cf85920b2e8473</id><updated>2012-12-24T09:36:47.291Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-12-24T09:36:47.291Z</app:edited><link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/photos/media/xyz%40gmail.com/63cf85920b2e8473'/><link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/photos/media/xyz%40gmail.com/63cf85920b2e8473'/></entry>
-----------------------------------------------------------

Greg Robbins

unread,
Dec 27, 2012, 2:36:56 AM12/27/12
to gdata-objec...@googlegroups.com
You'll likely have to refetch the newly uploaded photo to get its ETag.

This isn't a question about use of the Objective-C library specifically, so it's more appropriate for the Contacts API discussion, which has been moved to StackOverflow:


Reply all
Reply to author
Forward
0 new messages