Parse-server cloud code function 'Cannot POST'

試著忘記壹切 提交于 2019-12-04 04:33:20

The answer is that unlike with Parses hosted solution the API version path is not something hosted with parse-server

if you host parse at e.g.: /parse as I have done above, then that is the relative URL where the functions API is available. So simply remove the /1/ from the path

The same curl command works with this URL

http://localhost:1337/parse/functions/hello

eg:

curl -X POST \   
-H "X-Parse-Application-Id: myAppId" \   
-H "X-Parse-REST-API-Key:myRESTKey" \   
-H "Content-Type: application/json" \   
-d '{}' \  
http://localhost:1337/parse/functions/hello

I applied the "hello post" logic below to run a function that is defined in Parse Open Source cloud code in main.js hosted on heroku. I am trying to replace a former job that ran on parse.com. Started with Curl to try and be able to run function at will.

error: Cannot GET /parse/functions/sendOutboundProgressReport STATE: PERFORM => DONE handle 0x6000578c0; line 1981 (connection #2) multi_done Curl_http_done: called premature ==0 Connection #2 to host test-fake-app.herokuapp.com left intact Expire cleared


curl -v POST \

-H 'X-Parse-Application-Id: sadf435hsdgfatea' \ -H 'X-Parse-Master-Key: asdfsaasdfae4235dsgd' \ -H 'REST_KEY': asdfasq435636 \ -H "Content-Type: application/json" \ -H "X-Parse-Url: http://test-fake-app.herokuapp.com/parse" \

-d @send-template.json \

http://test-fake-app.herokuapp.com/parse/functions/sendOutboundProgressReport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!