我正在使用 Django 向 android 用户发送通知并请求库来处理发布请求。这是我将实际请求发送到 FCM 的代码片段。def sendNotification(rule_name): url = "https://fcm.googleapis.com/fcm/send" headers = {'Authorization': '********************', 'Content-Type': 'application/json'} myDict = {"to": "/topics/rules", "data": { "rule_name": rule_name } } r = requests.post(url, headers=headers, data=myDict) print r.status_code print r.text但是,当我打印状态代码和文本时得到的响应是:400 JSON_PARSING_ERROR:位置 0 处出现意外字符 (t)。你能指出我的代码有什么问题吗?
添加回答
举报
0/150
提交
取消