Google drive and authorized HTTP GET for downloading a file

后端 未结 1 524
清酒与你
清酒与你 2021-01-23 10:24

I develop application for Google Drive. I have problem with downloading files. Official doc describes this process with next words: \"To download a file\'s content, send an auth

相关标签:
1条回答
  • 2021-01-23 10:45

    To download the file's content, you will need to use an OAuth 2.0 access token in an authorized HTTP request such as:

    GET <dowloadUrl>
    Authorization: Bearer <ACCESS_TOKEN>
    

    You can try this with curl by using a command such as:

    curl <downloadUrl> -H 'Authorization: Bearer <ACCESS_TOKEN>'
    

    If you want to be able to download the file from a web browser using cookie authentication (using the cookies of the currently logged-in user), you should use the webContentLink instead.

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