我的应用程序在 appdata 文件夹中保留了一些应用程序特定文件。但是,当文件尝试更新云端硬盘应用程序数据中的文件时,反复从云端硬盘服务器收到内部错误。我正在使用 Objective-c 客户端调用 Drive API。
你能帮忙看看这些有什么问题吗?至少给出一些建议来找出此错误的原因。
以下是记录的请求和响应:
drive.files.update (bytes 0-40318/40319)
2014-05-19 09:23:44 +0000
Request: PUT https://www.googleapis.com/upload/rpc?uploadType=resumable&prettyPrint=false&upload_id=AEnB2Uo8yrae46aQQ-HYEtQgmXt2qNppZmkBYnPa8iXF4L6xdNYaVij6u3xLTT5kRIeH1mbPUUfUuEDEvYoouZheVwwWT6iw_A
Request headers:
Content-Length: 40319
Content-Range: bytes 0-40318/40319
Content-Type: binary/octet-stream
User-Agent: com.mycompanyname.appname/1.4.0 google-api-objc-client/2.0 MacOSX/10.8.5 (gzip)
Request body: (40319 bytes)
<<40319 bytes>>
Response: status 200
Response headers:
Alternate-Protocol: 443:quic
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 144
Content-Type: application/json; charset=UTF-8
Date: Mon, 19 May 2014 09:23:44 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: HTTP Upload Server Built on May 15 2014 11:06:48 (1400177208)
Response body: (144 bytes)
{
"error" : {
"message" : "Internal Error",
"data" : [
{
"reason" : "internalError",
"message" : "Internal Error",
"domain" : "global"
}
],
"code" : 500
},
"id" : "gtl_20"
}
-------------------------------------------------- ---------
Update
提出了一个很好的解决方法乔恩·斯基特 https://stackoverflow.com/users/22656/jon-skeet from:回答这个问题 https://stackoverflow.com/questions/23707388/unable-update-file-store-in-appdata-scope-500-internal-server-error
我已经成功重现了这个问题。没有 setNewRevision(false) 的话
有效 - 我意识到这可能并非在所有情况下都可行,但它是一个
目前对您来说合理的解决方法?
不过,我现在会暂缓这种解决方法。我们更愿意拥有setNewRevision(false)
,防止导致用户数据存储配额的使用增加 -http://developers.google.com/drive/v2/reference/files/update http://developers.google.com/drive/v2/reference/files/update