Javascript 由于服务器中的JSON错误,推送通知未发送

Javascript 由于服务器中的JSON错误,推送通知未发送,javascript,angularjs,json,parse-platform,push-notification,Javascript,Angularjs,Json,Parse Platform,Push Notification,我无法理解为什么json不正确。我使用了curl命令,它工作得非常好。发生此错误的原因是什么?我在底部包含了错误消息。所有其他论坛都说要在服务器URL的末尾添加/parse,但我已经这样做了 Parse.Cloud.define("TestNotification", function(request, response){ var query = new Parse.Query(Parse.Installation); query.equalTo("appName", "NewApp");

我无法理解为什么json不正确。我使用了curl命令,它工作得非常好。发生此错误的原因是什么?我在底部包含了错误消息。所有其他论坛都说要在服务器URL的末尾添加
/parse
,但我已经这样做了

Parse.Cloud.define("TestNotification", function(request, response){
var query = new Parse.Query(Parse.Installation);
  query.equalTo("appName", "NewApp");

  Parse.Push.send({
      where: query,
      data:{  
          title: request.params.title,
          alert: request.params.alert
      }
    }, { useMasterKey: true })
    .then(function() {
      response.success();
    }, function(error) {
      response.error(error);
  });
});
卷曲
curl-X POST-H“X-Parse-Application-Id:xxxxxxx”-H“X-Parse-Master-Key:xxxxxx”-H“内容类型:Application/json”-d'{“其中”:{“通道”:{“$in”:[“测试通道”]}},数据:{“警报”:“测试推送”}”https://xxxxx.herokuapp.com/parse/push

角度(我称之为云代码)

错误


message:'从Parse:Cannot POST/push收到一个包含无效JSON的错误\n'}}code=141,code=107,message=从Parse:Cannot POST/push收到一个包含无效JSON的错误:Cannot POST/push

您如何测试它?如何使用Parse服务器发送推送的唯一选项是使用云代码函数和Masterkey。。。用curl调用这个函数很好…@MazelTov我正在使用云代码函数和Masterkey@SteveMcMeen我使用我的parse仪表板和curl来测试通知是否真的发送并且do@joethemow请将curl命令添加到问题中。您如何测试它?使用解析服务器发送推送的唯一选项是使用云代码函数和主密钥。。。用curl调用这个函数很好…@MazelTov我正在使用云代码函数和Masterkey@SteveMcMeen我使用我的parse仪表板和curl来测试通知是否真的发送并且do@joethemow请将curl命令添加到问题中。
Parse.Cloud.run('TestNotification', {title: "title", alert: "alert"}).then(function(result) {
                    console.log(result);

                }, 
                function(error) {
                    console.log(error);
                });