【发布时间】:2013-03-10 01:46:35
【问题描述】:
我尝试使用来自 Google Drive documentation 的示例。 所以代码是:
var request = gapi.client.drive.files.delete({
'fileId' : someFileId
});
request.execute(function(resp)
{
console.log(resp);
});
应用程序已正确安装,我正在使用 drive.file 范围。 问题是文件没有被删除。它仍然存在于 Drive UI 中,无法再打开或下载。文件已损坏。
发送的请求不是文档中所述的 DELETE https://www.googleapis.com/drive/v2/files/fileId。这是一个 POST https://www.googleapis.com/rpc?key=API_KEY。正文包含一个 JSON 数组:
[{"jsonrpc":"2.0","id":"gapiRpc","method":"drive.files.delete","params":{"fileId":"someFileId"},"apiVersion":"v2"}]
响应包含一个空的 JSON 对象。响应中没有错误,页面中也没有 JS 错误。 APIs Explorer 已成功删除该文件。
有什么提示吗?
【问题讨论】:
标签: javascript google-drive-api