0

尝试删除条目时返回错误?

你不应该只是调用delete方法来删除条目吗!?

$this->client = Zend_Gdata_ClientLogin::getHttpClient($this->admin_user, $this->admin_pass, 'cp');
$this->client->setHeaders('If-Match: *');
$this->gdata = new Zend_Gdata($this->client);
$this->gdata->setMajorProtocolVersion(3);

$feed = $gdata->getFeed($query);
foreach($feed as $entry){
    $entry->delete();
}

错误:

ERROR: Expected response code 200, got 403
If-Match or If-None-Match header or entry etag attribute required
4

1 回答 1

2

编辑您的文件 App.php 并在第 538 行附近(至少我的情况),在函数内部prepareRequest()更改:

if ($method == 'DELETE') {
    $rawData = null;
}

对此

if ($method == 'DELETE') {
    $rawData = null;
    $headers['If-Match'] = '*';
}
于 2012-09-07T11:15:50.443 回答