【发布时间】:2013-09-18 00:47:05
【问题描述】:
我没有使用 google drive 的 sdk 我想通过我的应用程序在我的谷歌驱动器帐户上上传一个文件,我已为其设置了 url、headers、filename 的 post api。但我收到错误为“错误的内容类型。使用 multipart”。 我的代码如下-
文件文件 = 新文件(文件名);
字符串 url = "https://www.googleapis.com/upload/drive/v2/files/" + file.getName() + "?uploadType=multipart&access_token=" + accessToken;
headers.put("Content-type", "multipart/related");
response = GlobalConstants.SERVICE_CLIENT.Execute(url, "post", file, headers); //调用发帖。
请尽早提供帮助 提前谢谢
【问题讨论】:
标签: google-drive-api