启动 Parse.com - 为什么解析服务器的 cURL POST 在本地工作而不在 Heroku 上工作?
Booted off Parse.com - Why does cURL POST to parse-server work locally but not on Heroku?
运行 在 Heroku 上本地和远程运行的标准解析服务器 (ps) 示例。
使用我的云代码(我的应用程序)从 cURL 到 ps 示例的身份验证在 Heroku 上本地和远程工作。
- cURL POST 到本地 ps + 本地 mongodb 有效
- cURL GET 到本地 ps + 本地 mongodb 有效
- cURL POST 到本地 ps + mLab mongodb 有效
cURL GET 到本地 ps + 本地 mongodb 有效
然而,
cURL POST 到 Heroku ps + mLab mongodb 不工作 而是导致 Cannot POST /parse
错误。
节点文件 index.js
指向格式 https://myApp.herokuapp.com/parse/
的正确 heroku 地址
本地 cURL POST 改编自 the migration guide:
curl -X POST \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
本地 cURL 获取:
curl -X GET \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
http://localhost:1337/parse/classes/GameScore
远程 cURL POST :
curl -X POST \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
https://myApp.herokuapp.com/parse/
尝试解决问题 tips here 但毫无进展。
This SO post 似乎没有帮助。求助!
注意 远程 cURL post 如何不以 classes
路径指定结尾。将其用作您的远程 POST 目标:
https://myApp.herokuapp.com/parse/classes/GameScore
运行 在 Heroku 上本地和远程运行的标准解析服务器 (ps) 示例。 使用我的云代码(我的应用程序)从 cURL 到 ps 示例的身份验证在 Heroku 上本地和远程工作。
- cURL POST 到本地 ps + 本地 mongodb 有效
- cURL GET 到本地 ps + 本地 mongodb 有效
- cURL POST 到本地 ps + mLab mongodb 有效
cURL GET 到本地 ps + 本地 mongodb 有效
然而,
cURL POST 到 Heroku ps + mLab mongodb 不工作 而是导致
Cannot POST /parse
错误。
节点文件 index.js
指向格式 https://myApp.herokuapp.com/parse/
本地 cURL POST 改编自 the migration guide:
curl -X POST \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
本地 cURL 获取:
curl -X GET \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
http://localhost:1337/parse/classes/GameScore
远程 cURL POST :
curl -X POST \
-H "X-Parse-Application-Id: appID" \
-H "X-Parse-Client-Key: clientKey" \
-H "X-Parse-REST-API-Key: restKey" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
https://myApp.herokuapp.com/parse/
尝试解决问题 tips here 但毫无进展。 This SO post 似乎没有帮助。求助!
注意 远程 cURL post 如何不以 classes
路径指定结尾。将其用作您的远程 POST 目标:
https://myApp.herokuapp.com/parse/classes/GameScore