【发布时间】:2016-05-01 22:03:13
【问题描述】:
试图了解我自托管 Parse 服务器上的云代码。
我正在尝试在 Swift 中调用我的云代码函数,向其传递一个参数,然后将其从云代码返回到我的应用程序以进行打印。 ISSUE:我不知道 Parse Cloud Code 上的代码返回发送给它的参数是什么样子的。我已经尝试过了,但没有运气......
Parse.Cloud.define('hello', function(req, res) {
res.success(request.params['test']);
});
这是我的 Swift 代码...
PFCloud.callFunctionInBackground("hello", withParameters: ["test":"tester"]) {
(response: AnyObject?, error: NSError?) -> Void in
if error == nil {
let responseString = response as? String
print(responseString)
} else {
print(error!.description)
}
}
有人可以帮我吗?使用上面的代码,我从print(error!.description) 收到此错误...
2016-05-01 17:51:32.031 TestApp[662:151287] [错误]: {"code":1,"message":"Internal server error."}(代码:1,版本:1.13。 0) 错误域=解析代码=1 "{"code":1,"message":"内部服务器错误。"}" UserInfo={error={"code":1,"message":"内部服务器错误。"} , NSLocalizedDescription={"code":1,"message":"内部服务器错误。"}, code=1}
【问题讨论】:
标签: node.js parse-platform parse-cloud-code