在Google文档中没有写到它,我使用的是retrofit 2. Help。写下应该发送什么请求以及传输什么参数
界面:
@PATCH("drive/v3/files/{fileId}")
@Multipart
Call<ResponseBody> renameFileGoogle(
@Path("fileId")String fileId,
@Part MultipartBody.Part metaPart
);
调用方法:
public void renameMetod(String id, String title) {
String content = "{\"name\": \"" + title + "\"}";
MediaType contentType = MediaType.parse("application/json; charset=UTF-8");
MultipartBody.Part metaPart = MultipartBody.Part.create(RequestBody.create(contentType, content));
Call<ResponseBody> renameRequest = server.renameFileGoogle(id, metaPart);
renameRequest.enqueue(new Callback<ResponseBody>()...
它在文档中https://developers.google.com/drive/v2/reference/files/patch
您需要发送 HTTP PATCH 请求
PATCH https://www.googleapis.com/drive/v2/files/{fileId}
RequestBody:
{"title":"newTitle"}
对于版本 3https://developers.google.com/drive/v3/reference/files/update
PATCH https://www.googleapis.com/drive/v3/files/{fileId}
RequestBody:
{"name":"newTitle"}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)