Android - Google Drive HTTP Request

后端 未结 2 1823
野趣味
野趣味 2021-01-05 16:35

I am trying to write an application which can upload files to Google Drive. I have chosen to interact with this service via raw http requests as I haven\'t found any useful

相关标签:
2条回答
  • 2021-01-05 17:11

    If you use HTTPS, GET instead of POST and a Bearer token it works.

    using curl:

    curl -H "Authorization: Bearer {TOKEN}" \
    -H "Content-Type: application/json" \
    https://www.googleapis.com/drive/v2/files
    

    I have no idea why google is not documenting the REST API. Please comment if you found the documentation somewhere.

    0 讨论(0)
  • 2021-01-05 17:15

    Are you sure your token is valid for Drive Scopes ? The test you mention at the end of your question is not on the same scope.

    Also, don't forget that Oauht2 token are valid only for one hour. You may need to request another one or to use your refresh token, if you have one.

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