Hi, This should work for ClientLogin, change Authorization: AuthSub token="yourAuthToken" if you want to use AuthSub.
<?php $url = "http://www.google.com/m8/feeds/photos/media/user%40domain.com/ 1"; # 1 is a CONTACT-ID $authToken = "DQ..."; $header[] = "Authorization: GoogleLogin auth=".$authToken; $header[] = "Content-type: application/x-www-form-urlencoded"; $header[] = "If-Match: *"; $header[] = "GData-Version: 2"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"DELETE"); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); $output = curl_exec($ch); $info = curl_getinfo($ch); print_r( $info ); # you should get a http_code 200 ?> --Julian On Apr 15, 2:49 pm, Devang Parekh <[email protected]> wrote: > hi julian... > Thanks for reply but there is no change. Image is still there. > > $url =http://www.google.com/m8/feeds/photos/media/user%40domain.com/44e1ab3... > > $header[] = "Authorization: AuthSub token=".$authToken; > $header[] = "Content-type: application/x-www-form-urlencoded"; > $header[] = "If-Match: *"; > $header[] = "GData-Version: 2"; > $header[] = "X-HTTP-Method-Override: DELETE"; > $header[] = "Cache-Control: no-cache"; > $header[] = "Connection: close"; > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > curl_setopt($ch, CURLOPT_FAILONERROR, true); > curl_setopt($ch, CURLOPT_POST,1); > curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"POST"); > curl_setopt($ch, CURLOPT_HTTPHEADER, $header); > $response = curl_exec($ch); > > This is my actual code. Reply soon plz.. > > On Wed, Apr 15, 2009 at 6:53 PM, Julian (Google) <[email protected]> wrote: > > > Hi, > > > You could try to do a HTTP DELETE like the following sample, using the > > Contact Photo Link and any ETag (or an specific one if necessary): > > > DELETEhttp://www.google.com/m8/feeds/photos/media/user%40domain.com/1 > > Authorization: GoogleLogin auth=DQ... > > If-Match: * > > Content-Type: application/x-www-form-urlencoded > > GData-Version: 2 > > > -Julian > > > On Apr 14, 1:42 pm, D2 <[email protected]> wrote: > > > HTTP - HEADER > > > > "Host:www.google.com" > > > "MIME-Version: 1.0" > > > "Accept: text/plain" > > > "Content-type: image/*" > > > "Authorization: AuthSub token=AUTH-TOKEN" > > > "X-HTTP-Method-Override: DELETE" > > > "Cache-Control: no-cache" > > > "If-Match: E-TAG" > > > "GData-Version: 2" > > > "Connection: close" > > > > URL : > >http://www.google.com/m8/feeds/photos/media/EMAIL-ADDRESS/f6bf7740bdc... > > > > I want to delete photo for a perticular Contact. Above is my > > > http_header to delete photo. & url is same as i get from "rel#photo". > > > > when i proccess this, I get http_response 200. But image remains as it > > > is. > > > > Anything wrong in this code?? please reply soon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
