【发布时间】:2018-05-23 21:20:00
【问题描述】:
我想删除 Google API 供稿的联系人列表。
我生成以下 XML 正文:
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:gContact="http://schemas.google.com/contact/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:batch="http://schemas.google.com/gdata/batch">
<entry>
<batch:id>delete</batch:id>
<batch:operation type="delete"/>
<id>http://www.google.com/m8/feeds/contacts/<email>/base/c001f30f8a96bd</id>
</entry>
<entry>
<batch:id>delete</batch:id>
<batch:operation type="delete"/>
<id>http://www.google.com/m8/feeds/contacts/<email>/base/13112ef0ace9063</id>
</entry>
</feed>
之后,我调用了 Google_Http_Request
$req = new \Google_Http_Request('https://www.google.com/m8/feeds/contacts/default/full/batch/');
$req->setRequestHeaders(array('content-type' => 'application/atom+xml; charset=UTF-8; type=feed'));
$req->setRequestMethod('DELETE');
$req->setPostBody($myXML);
Google 向我发送错误 500。
我不知道我的问题出在哪里。有人有想法吗?
非常感谢,
【问题讨论】:
-
前段时间我遇到了类似的问题。也许这可以帮助stackoverflow.com/questions/47764210/…