gpt4 book ai didi

javascript - Google Drive API v3 不列出文件/文件夹的指定元数据

转载 作者:行者123 更新时间:2023-11-30 09:21:24 25 4
gpt4 key购买 nike

您好,我在尝试使用 Google Drive API v3 和 javascript 检索指定的元数据字段时遇到了麻烦。

我为此使用通用 API 请求:

gapi.client.request({
'path': 'https://www.googleapis.com/drive/v3/files/'+fileId,
'fields': "files(id, name, size, parents)",
'method': 'GET'
})

但响应列表只是

    "kind": "drive#file",
"id": "0B99ZF.........Z",
"name": "...",
"mimeType": "..."

如何列出请求中指定的元数据:

'fields': 'files(id, name, size, parents)'

感谢您的回复。

最佳答案

您错误地构造了 gapi.client.request 的参数对象。尝试...

gapi.client.request({
'path': 'https://www.googleapis.com/drive/v3/files/'+fileId,
'params' : {'fields': "*"},
'method': 'GET'
})

或者简单地将 &fields=* 添加到您的 URL。参见 https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiclientrequest

关于javascript - Google Drive API v3 不列出文件/文件夹的指定元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51406491/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com