如何使用 google drive api in javascript with axios 删除多个文件夹?
how to delete multiple folders using google drive api in javascript with axios?
我正在尝试使用 google 驱动器 api 删除 google 驱动器的多个文件,但出现 404 错误
axios.delete('https://www.googleapis.com/drive/v3/files',{
params:{
fileId:'1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E,1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E',
supportsTeamDrives: 'false',
},
headers: {
authorization: `Bearer ${accessToken}`
}
})
.then(res=>{ console.log(res.data) })
.catch(err=>{ console.log(err) })
您必须将 fileId
作为路径参数传递:
axios.delete('https://www.googleapis.com/drive/v3/files/1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E,1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E', {
headers: {
authorization: `Bearer ${accessToken}`
}
})
.then(res => { console.log(res.data); })
.catch(err => { console.log(err); });
我正在尝试使用 google 驱动器 api 删除 google 驱动器的多个文件,但出现 404 错误
axios.delete('https://www.googleapis.com/drive/v3/files',{
params:{
fileId:'1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E,1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E',
supportsTeamDrives: 'false',
},
headers: {
authorization: `Bearer ${accessToken}`
}
})
.then(res=>{ console.log(res.data) })
.catch(err=>{ console.log(err) })
您必须将 fileId
作为路径参数传递:
axios.delete('https://www.googleapis.com/drive/v3/files/1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E,1nJddic7Gc_x8NQBzwOPhglwfYI-_Ms5E', {
headers: {
authorization: `Bearer ${accessToken}`
}
})
.then(res => { console.log(res.data); })
.catch(err => { console.log(err); });