1
我正在使用驅動器版本2向Google驅動器插入新文件。 使用client.files.insert()函數將新文件插入到谷歌驅動器錯誤:在使用googleapis節點模塊時multipart中缺少身體屬性
我收到以下錯誤 錯誤:多部分中缺少正文屬性。
var auth = new googleapis.OAuth2Client();
auth.setCredentials({
access_token: 'accesskey'
});
googleapis.discover('drive', 'v2').execute(function(err, client) {
client.drive.files.insert({ title: 'Test', mimeType: 'application/json' })
.withMedia('application/json', "Hello world")
.withAuthClient(auth)
.execute(function(error,result){
if(error){
console.log(error);
}else{
console.log(result);
}
});
上面的代碼中存在的文檔:https://github.com/google/google-api-nodejs-client/
可以在任何幫助我!