【发布时间】:2015-04-13 13:40:18
【问题描述】:
我正在使用 Drive REST API 下载文件。我正在使用文件 ID 发出 GET 请求,我得到一个 file not found exception。
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "File not found: xxxxx",
"locationType": "other",
"location": "file"
}
],
"code": 404,
"message": "File not found: xxxxx"
}
}
我还生成了 apikey,并在我的 GET 请求中使用它。该文件确实存在,所以我不确定我在这里缺少什么。
【问题讨论】:
-
将 http 请求/响应粘贴到您的问题中,以便我们查看发生了什么。表面上该消息是不言自明的,所以我怀疑文件 ID 的值。
-
404 是找不到资源。很可能是 url 不正确。如果您能够获取该文件,请尝试在浏览器中访问该文件。您也可以在 API 资源管理器中尝试:developers.google.com/drive/v2/reference/files/get#try-it
标签: google-drive-api