推送通知失败 [英] Push notif failed with curl
问题描述
我正在测试用于Android开发的推送通知,目前正在使用Windows作为推送程序.当我在终端中运行此命令时,出现以下错误:'''{错误":错误请求",描述":无法将正文作为JSON对象读取"}'''''更多细节 :错误图片
I am testing push notification for android development and i am currently use windows as pusher. When I run this command in terminal , i have this error : '''{"error":"Bad Request","description":"Failed to read body as a JSON object"}''' for more details : Error image
推荐答案
通过更改json数据的格式解决(针对 windows 用户)来自: -d'{"interests":["hello"],"fcm":{"notification":{"title":"Hello","body":"Hello,world!"}}}'
Solved by changing the format of json data (for windows users) from : -d '{"interests":["hello"],"fcm":{"notification":{"title":"Hello","body":"Hello, world!"}}}'
至: -d"{\" interests \:[\" hello \],\" fcm \:{\" notification \:{\" title \:\" Hello \,\" body \:\"你好,世界!\}}}"
这篇关于推送通知失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!