PHP Classes

Google DELETE (If-Match */<etag>

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Google DELETE (If-Match */<etag>  >  (Un) Subscribe thread alerts  
Subject:Google DELETE (If-Match */<etag>
Summary:Google DELETE (If-Match */<etag> Concern
Messages:3
Author:Justin
Date:2015-02-27 17:58:01
 

  1. Google DELETE (If-Match */<etag>   Reply   Report abuse  
Picture of Justin Justin - 2015-02-27 17:58:01
Hello,

Just was wondering if someone could help me out here.
I have been able to make all my calls to Google except for my delete request.

I am currently, using the right URL, V=3.0, I have set, option['If-match'=>'*]

And I continue to get this error, Any thoughts on how to properly set If-Match?

<code>forbidden</code>
<internalReason>If-Match or If-None-Match header or entry etag attribute required</internalReason>


Thanks.

  2. Re: Google DELETE (If-Match */<etag>   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-28 22:00:50 - In reply to message 1 from Justin
In the options parameter of the CallAPI function you can use the RequestHeaders parameter to specify custom request headers like this:

$api_url = 'https://www.googleapis.com/some-google-api-url';
$options = array(
'RequestHeaders'=>array(
'If-Match'=>'if match value here',
'FailOnAccessError'=>true
);
$success = $client->CallAPI($api_url, 'DELETE', array(), $options, $results);

  3. Re: Google DELETE (If-Match */<etag>   Reply   Report abuse  
Picture of Justin Justin - 2015-03-01 04:41:16 - In reply to message 2 from Manuel Lemos
Ahhhhhh MANUEL, perfection. Thank you for that!!
Much appreciation, thought I was going crazy....

Appreciate the support you provide.