我试图通过云代码删除文件。 但此脚本失败:解析云功能失败
Parse.Cloud.define("deleteFile1", function(request, response) {
Parse.Cloud.httpRequest({
method: 'DELETE',
url: 'https://api.parse.com/1/files/****.png',
headers: {
"X-Parse-Application-Id": "*******",
"X-Parse-REST-API-Key" : "*******"
},
success: function(httpResponse) {
console.log('Delete succeeded ' + httpResponse.text);
response.success();
},
error: function(httpResponse) {
response.error("failed");
}
});
});
有错误141,脚本失败。
我这样称呼它:
Map<String, String> map = new HashMap<String, String>();
ParseCloud.callFunctionInBackground("deleteFile1", map, new FunctionCallback<Object>() {
@Override
public void done(Object object, ParseException e) {
if(e == null){
}else{
System.out.println(e.getCode());
utils.toast_error("Couldn't delete image.. try again");
}
}
});
我检查我的主要的,他们是正确的。所以脚本本身在某些方面肯定是错的。我想也许是网址。 /文件假设是图像文件绑定的ParseFile?我试着改变“请求”&“响应”到httpResponse等,但它没有任何区别。
呵呵没问题!是的,我也看到了,主要区别是什么? – Benni
[Heroku](https://www.heroku.com/home)基本上只是Cloud Code的一个更大,更好,功能全面的版本。 (以同样的方式,麦克拉伦P1就像一个更新的,功能齐全的T型福特...) –