url1 = "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token="+access_token+"&type={}"
response = requests.post(url1, files=files)
tmid=response.json()["media_id"]
article = {
"title": "你好,世界",
"author": "asdf",
"thumb_media_id": tmid,
"content": "欢迎使用微信公众号推送功能!"
}
url = "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token="+access_token+"&type=TYPE"
responseDraft = requests.post(url, json=article)
resultDraft = responseDraft.json()
{'errcode': 41005,
'errmsg': 'media data missing hint: [1mwSha0724p566] rid: 66855f53-63bb583c-3d1d275a'}
这是nodejs写的?可能是异步的问题。试试 tmid = response.json() → await response.json()