【发布时间】:2014-10-02 17:31:06
【问题描述】:
我正在尝试使用 Administrative API 在 Google Search Appliance 上创建集合
我成功检索了授权令牌,但在发布 XML 以创建集合时,我收到有关我的 xml 的错误。
<errors xmlns=\'http://schemas.google.com/g/2005\'><error><domain>GData</domain><code>ParseException</code><internalReason>Element type "gsa:content" must be followed by either attribute specifications, ">" or "/>".</internalReason></error></errors>
这是我的有效载荷:
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gsa='http://schemas.google.com/gsa/2007'>
<gsa:content name='collectionName'>testcollection</gsa:content>
<gsa:content name='insertMethod''>default</gsa:content>
</entry>
这是我的蟒蛇:
>> print headers
{'Content-Type': 'application/atom+xml', 'Authorization': 'GoogleLogin auth=googleauthtoken'}
>>> print url
http://GSA_ip:8000/feeds/collection
>>> r = requests.post(url, data=payload, headers=headers, verify=False)
【问题讨论】:
标签: python xml google-search-appliance