小编Air*_*ity的帖子

如何使用 axios 设置对 google Drive api 的 api 请求

我正在开发一个谷歌驱动器项目,但我无法使用 Axios 将搜索参数从前端 React 发送到谷歌 API

可以向我解释一下如何编写像 google Drive api url 这样的查询吗

  1. 按日期搜索所有文件和文件夹
  2. 按大小查找文件
  3. 查找所有空文件夹
  4. 按类型查找文件,例如 ppt、图像等

axios 请求看起来像这样

 axios.get('https://www.googleapis.com/drive/v3/files?access_token='+accessToken+'&q=mimeType%3D%22application%2Fvnd.google-apps.folder%22').then(res=>{
    console.log(res)
    setFolders(res.data.files)
}).then(err=>{
    console.log(err)
})
Run Code Online (Sandbox Code Playgroud)

提前致谢 :)

javascript google-api google-drive-api reactjs axios

4
推荐指数
1
解决办法
2180
查看次数