使用PHP的Google日历ACL规则

使用PHP的Google日历ACL规则,php,google-calendar-api,Php,Google Calendar Api,为什么它返回这个输出“Error:The requested URL returned Error:400”而不是发送请求 $headers=array(“授权:GoogleLogin auth=“.this->auth.”, “GData版本:2.0”, “传输编码:分块”, “内容类型:应用程序/atom+xml” ); $xmlstr=” "; $url=”http://www.google.com/calendar/feeds/$calu-id/acl/full/user%3A“.url

为什么它返回这个输出“Error:The requested URL returned Error:400”而不是发送请求

$headers=array(“授权:GoogleLogin auth=“.this->auth.”, “GData版本:2.0”, “传输编码:分块”, “内容类型:应用程序/atom+xml” );

$xmlstr=”
";
$url=”http://www.google.com/calendar/feeds/$calu-id/acl/full/user%3A“.urlencode($email-id)”;
curl_setopt($this->curl,CURLOPT_URL,$URL);
curl_setopt($this->curl,CURLOPT_HTTPHEADER,$headers);
curl_setopt($this->curl,CURLOPT_CUSTOMREQUEST,'DELETE');
curl_setopt($this->curl,CURLOPT_POSTFIELDS,$xmlstr);
curl_setopt($this->curl,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($this->curl,CURLOPT_AUTOREFERER,true);
curl\u setopt($this->curl,CURLINFO\u HEADER\u OUT,false);
curl_setopt($this->curl,CURLOPT_VERBOSE,true);
curl_setopt($this->curl,CURLOPT_FAILONERROR,true);
curl_setopt($this->curl,CURLOPT_COOKIESESSION,true);
curl_setopt($this->curl,CURLOPT_头,0);
curl_setopt($this->curl,CURLOPT_UNRESTRICTED_AUTH,true);
$response=curl\u exec($this->curl);

请注意PHP API使用的是V1,当然是最旧的版本:( 因此,我们用于更新ACL的xml与V2上的指南略有不同

我使用的是:

<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2007' >
          <category scheme='http://schemas.google.com/g/2005#kind'
            term='http://schemas.google.com/acl/2007#accessRule'/>

注意,我不使用“gd:etag”元素

其余xml与您相同。另外一个建议是将url更改为HTTPS,而不是HTTP,并添加“xoauth\u请求者\u id=”。如果需要,urlencode($USER)

那么你准备好出发了,如果有帮助,请告诉我们

<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2007' >
          <category scheme='http://schemas.google.com/g/2005#kind'
            term='http://schemas.google.com/acl/2007#accessRule'/>