解析服务器响应"意外令牌"

nas*_*sch 5 heroku parse-platform parse-server

我正在努力在Heroku上放置一个Parse Server.我正在使用这个应用程序:

https://github.com/ParsePlatform/parse-server-example

使用本指南上传到heroku:

https://devcenter.heroku.com/articles/getting-started-with-nodejs

我已经更新了解析服务器代码中的数据库和服务器URL,并且所有内容都已正确上传和部署.但是,当我尝试使用cURL测试服务器时,如本指南所示:

https://github.com/ParsePlatform/parse-server

我收到以下错误:

{"error":"Unexpected token '"}
Run Code Online (Sandbox Code Playgroud)

我复制并粘贴了cURL命令,为我的url修改了:

curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://my-app-name.herokuapp.com/parse/classes/GameScore
Run Code Online (Sandbox Code Playgroud)

Heroku日志显示请求进来(所以我知道它到了正确的地方)但没有错误.我正在从Windows 7部署,如果这很重要的话.这是我对heroku和解析服务器的第一次体验,所以我有点盲目飞行.有谁看到问题?

Dan*_*usa 0

尝试将 POST 数据字段的简单引号反转为双引号,这对我有用:

#here : "{'score':1337,'playerName':'Sean Plott','cheatMode':false}"

curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d "{'score':1337,'playerName':'Sean Plott','cheatMode':false}" http://my-app-name.herokuapp.com/parse/classes/GameScore
Run Code Online (Sandbox Code Playgroud)

反而

#here : '{"score":1337,"playerName":"Sean Plott","cheatMode":false}'
curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://my-app-name.herokuapp.com/parse/classes/GameScore
Run Code Online (Sandbox Code Playgroud)