您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何使用Google云端硬盘API一次删除多个文件

如何使用Google云端硬盘API一次删除多个文件

您可以将多个Drive API请求一起批处理。这样的事情应该可以在Python API客户端库中使用

def delete_file(request_id, response, exception):
  if exception is not None:
    # Do something with the exception
    pass
  else:
    # Do something with the response
    pass

batch = service.new_batch_HTTP_Request(callback=delete_file)

for file in children["items"]:
  batch.add(service.files().delete(fileId=file["id"]))

batch.execute(http=http)
Go 2022/1/1 18:41:45 有333人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶