接口文档实在太难用了,快救救孩子吧
代码如下,报错解析错误,这鬼接口也是醉了,例子也是外包搞的吧,我还能怎么弄
api = self.domain + '/tcb/databaseadd?access_token=' + self.access_token
body = {
'env': 'moyu-2g6ns08f0bfe8d112dd',
'query': '''db.collection("%s").add({
data=[{
ts: 1617205679,
loc: "浙江·杭州",
pic: "https://gitlab.com/wi-koo/new_home.jpg",
content: "燕子来时新社,梨花落后清明"
}]
})''' % (col)
}
print(body)
r = requests.post(api, json=body)
print(r.json())