想用python操作小程序云数据库, 返回的是错误47001 post body格式错误。搞不懂了。求教啊
import requests,json
url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=appid&secret=secret"
res = requests.get(url)
token= res.json()
token=token["access_token"]
post_url="https://api.weixin.qq.com/tcb/databaseupdate?access_token="+token
body={
"env":"ymxsc",
"collection_name": "testadd"
}
headers= {'content-type': 'application/json'}
postgo =requests.post(post_url,headers=headers,data=json.dumps(body))
print(postgo.text)
你能亮出全部代码吗,关键的代码都没亮出来
env
collection_name 就这俩啊,大佬求解,人要疯掉了