您当前的位置: 首页 >  ar

顺其自然~

暂无认证

  • 4浏览

    0关注

    1317博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

极光推送使用curl调用REST API出现测试出现{“error“:{“code“:1002,“message“:“Missing parameter“}}

顺其自然~ 发布时间:2022-06-15 10:40:28 ,浏览量:4

今天测试极光推送的时候,根据官网的给的例子使用curl调用的时候出现以下错误:

{"error":{"code":1002,"message":"Missing parameter"}}* Connection #0 to host api.jpush.cn left intac

这是因为 windows版本下单引号要改成双引号,json格式数据中双引号要加\转义,列如官网的例子是

curl --insecure -X POST -v https://api.jpush.cn/v3/push -H "Content-Type: application/json"
-u "appKey:masterSecret"
-d  '{"platform":"all","audience":"all","notification":{"alert":"Hi,JPush!"}}'

在windows下改成即可正常请求:

curl --insecure -X POST -v https://api.jpush.cn/v3/push -H "Content-Type: application/json"
-u "appKey:masterSecret"
-d  "{\"platform\":\"all\",\"audience\":\"all\",\"notification\":{\"alert\":\"Hi,JPush!\"}}"

原文链接:https://blog.csdn.net/man_to_home/article/details/100010297

关注
打赏
1662339380
查看更多评论
立即登录/注册

微信扫码登录

0.1096s