问题描述
嗨,我有以下代码:
import requests
import json
header = {"Content-Type": "application/json; charset=utf-8","Authorization": "Basic NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj"}
payload = {"app_id": "APP ID HERE","included_segments": ["Active Users"],"contents": {"en": "This is a test message from python"}}
req = requests.post("https://onesignal.com/api/v1/notifications",headers=header,data=json.dumps(payload))
print(req.status_code,req.reason)
我输入了正确的APP ID,但是当我运行代码时,出现以下错误:
400错误的请求
请有人告诉我我要去哪里错了。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)