How do I rename a file to google drive rest api? Retrofit2

后端 未结 1 1686
耶瑟儿~
耶瑟儿~ 2021-01-19 07:39

In the Google documentation about it is not written, I use retrofit 2. Help. Write what request should be sent and what parameters to transmit

interface:

1条回答
  •  礼貌的吻别
    2021-01-19 08:37

    It's there in the documentation https://developers.google.com/drive/v2/reference/files/patch

    You need to send an HTTP PATCH request

    PATCH https://www.googleapis.com/drive/v2/files/{fileId}
    
    RequestBody:
    {"title":"newTitle"}
    

    For version 3 https://developers.google.com/drive/v3/reference/files/update

    PATCH https://www.googleapis.com/drive/v3/files/{fileId}
    RequestBody:
    {"name":"newTitle"}
    

    0 讨论(0)
提交回复
热议问题