-
Notifications
You must be signed in to change notification settings - Fork 301
FAQ 遇到问题可先自查 #72
Comments
不应该是json=data嘛,不是data=data吧
…---原始邮件---
发件人: ***@***.***>
发送时间: 2024年6月13日(周四) 晚上9:01
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: Re: [danni-cool/wechatbot-webhook] FAQ 遇到问题可先自查 (Issue #72)
请问下 发送文件的接口,改成 python 的写法如何编写的,一直提示 "request body is not a valid json! checkout please."
curl --location --request POST 'http://localhost:3001/webhook/msg?token=[YOUR_PERSONAL_TOKEN]'
--form 'to=testGroup'
--form content=@"$HOME/demo.jpg"
--form 'isRoom=1'
python 代码如下:
headers = {}
files = {
'content': (file_name, open(_wx_bot_file_path, 'rb'), mime_type),
}
data = {
'to': 'test',
'isRoom': '1' # 确保值为字符串,避免可能的数据类型问题
}
params = {
'token': '123456'
}
r = requests.post(self.send_message_api_url, headers=headers, files=files, data=data, params=params)
print(f'respone: {r.text}')
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
改成 json=data 还是提示 request body is not a valid json! checkout please. ![]() |
files = {'content': open(_wx_bot_file_path, 'rb')} r = requests.post(self.send_message_api_url, files=files, data=data) 这样可以了! |
1. 登陆问题
1.1 微信个人信息合规问题 (新号请:实名+绑定手机号+绑定银行卡)
1.2 登录时 AssertionError: 1205 == 0
1.3 触发了微信风控机制被限制登录
2. 掉线问题
2.1 登陆一段时间后掉线问题,web协议受微信风控策略控制,固定2天一掉。
2. 发送消息问题
2.2 文字没法换行,请使用
\n
转义字符2.3发送消息 1205 == 0 || 1204==0
2.4 字符编码问题
2.5 无法给文件传输助手发消息 User is not found
2.6无法艾特人
2.7发送昵称重复时会发给谁
2.8发送消息时 {"success":false,"message":"Unauthorized: Access is denied due to invalid credentials."}
2.9 发送给备注名时格式错误
2.10 发送消息提示成功,但是实际未收到消息
3. 联系人or群成员信息不是最新的
3.1 wechaty 信息同步问题:暂时不修复,重启容器解决(欢迎贡献PR)
4. 收消息问题
4.1 无法区分是否是真 @,Wechaty 也是不区分的,有一原则上真 @ 和 @+手打你的昵称都算
4.2 如何判断消息是否是引用消息
The text was updated successfully, but these errors were encountered: