原因:
data参数写法有误,应该将 data参数包裹并json.dupms(data)处理;
正确写法:
import requests
import json
url = "https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token=62_-eltMQqJJ46DMWkPhAMLuaQvfXznNrkMCBcdoJ3S86YHsocLJ_uD0bzNdWmf865nR-agB5XtxhjIYFJi5tgm-O0kaFnCUL1ITesHjrJyN6jprC2FVZwhKS70iGiePp911jmCVgcxZaWYqOQ7XUPeAJALID"
payload = json.dumps({
"offset": 0,
"count": 10,
"no_content": 0
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
全选代码
复制
修改werobot接口数据
参考:
[后台能看到素材文章,但是调用接口获取报错出现40097状态码? | 微信开放社区](https://developers.weixin.qq.com/community/develop/doc/000a60978a8950d4594d0560751800)
[获取不到发布列表信息? | 微信开放社区](https://developers.weixin.qq.com/community/develop/doc/00086ac4250ff05d362da122556000?highLine=40097)
标签:python,微信,weixin,json,https,data,40097 From: https://www.cnblogs.com/ministep/p/16839754.html