all these headers including if-match are set automatically by Zend_Gdata. at least in the newer version. no need to worry about them. Follow the documenation on the official site (framework.zend.com) or, if no luck -> paste more of your code somewhere.
On Fri, Nov 27, 2009 at 12:09 PM, Julian (Google) <[email protected]> wrote: > Hi, > > Here is a example using Zend objects using Contacts v1: > > Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); > Zend_Loader::loadClass('Zend_Gdata_Gapps'); > Zend_Loader::loadClass('Zend_Gdata_Query'); > Zend_Loader::loadClass('Zend_Http_Response'); > > $rawImage = file_get_contents("photo.jpg"); > $link_photo_edit = 'http://www.google.com/m8/feeds/photos/media/USER > %40DOMAIN.com/0/g2B66Nd0Hj9kBIDs0lZCxQ'; > $client = Zend_Gdata_ClientLogin::getHttpClient("[email protected]", > "PASS", "cp"); > $token = $client->getClientLoginToken(); > $client->setUri($link_photo_edit); > $client->setHeaders( array("Content-type: image/jpeg","Authorization: > GoogleLogin auth=".$token, "Content-length: ".strlen($rawImage2)) ); > $client->setRawData($rawImage); > $http_response = $client->request('PUT'); > print_r($http_response); > > Are you using a higher version? v2 or v3? If that is the case you need > to add the header If-Match with the ETag or If-Match: * > > Cheers, > Julian > > On Nov 26, 1:39 pm, boredom2 <[email protected]> wrote: > > Hi there, > > > > although the Zend Framework does not offer an explicit contact api, it > > workds quite well - except updateing a photo. > > after getting the data from the specific contact, i try > > > > $raw=file_get_contents(LOCAL PHOTO FILE); > > $this->handle->put($raw,PHOTO URL FROM FEED,null,'image/jpeg'); > > > > thats basically the opposite of the way, i get photos. > > > > but all i get is > > > > Expected response code 200, got 400 Unexpected resource version ID > > > > i think, i must send an etag - is this correct? > > and what about contacts without current photo, they dont have an etag, > > but i got the same error. > > > > any ideas? > > > > thank you very much, > > Christoph > > Germany > > -- > > You received this message because you are subscribed to the Google Groups > "Google Contacts API" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-contacts-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-contacts-api?hl=en. > > > -- Alexander Steshenko | http://lcf.name -- You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en.
