【问题标题】:Parse cloude function http request not working解析cloude函数http请求不起作用
【发布时间】:2016-08-22 12:25:36
【问题描述】:

我已经用 curl 尝试了以下代码,但它现在可以工作了,请看一下,谢谢

功能:

Parse.Cloud.define('hello', function(req, res) {
  res.success('Hello world!');
});

卷曲网址:

curl -X POST -H "X-Parse-Application-Id: xxx" -H "X-Parse-REST-API-Key: xxx" [http][xxx]/parse/functions/hello

错误:

Result: TypeError: Cannot call method 'runRequestListener' of undefined
at handleRequest (http.js:551:11)
at Parse.Cloud._runCustomEndpoint (<anonymous>:204:7)

【问题讨论】:

  • 是否必须登录才能执行云代码?

标签: javascript curl parse-platform


【解决方案1】:

知道了,

问题是 URL。 我以为 URL 是我们的域名,但它是一个解析 API,如下 CURL 请求工作正常。

curl -X POST -H "X-Parse-Application-Id: xxx" -H "X-Parse-REST-API-Key: xxx" [https][api.parse.com]/1/functions/hello

【讨论】:

  • 您知道它们的服役时间不会超过 2017 年 1 月,对吧?所以你应该真正使用你自己的实例而不是他们的基础设施。
  • 是的,我知道,迁移正在进行中。谢谢@mistapink
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-01-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-23
  • 2018-04-24
  • 2016-09-21
相关资源
最近更新 更多