我試圖通過雲代碼刪除文件。 但此腳本失敗:解析雲功能失敗
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型福特...) –