在Google Drive API插入/上传中使用node.js [英] Use of node.js with Google Drive API insert / upload

查看:165
本文介绍了在Google Drive API插入/上传中使用node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://developers.google.com/drive/v2上的文档/ reference / files / insert for JavaScript旨在用于客户端JS库。试图使用相应的node.js库,我遇到了调用request()的问题,因为它看起来不是一个。

The documentation at https://developers.google.com/drive/v2/reference/files/insert for JavaScript is intended for use of the client-side JS library. Trying to use the corresponding node.js library, I'm running into problems calling request(), since there doesn't appear to be one.

网络调用,而不使用库,是否有相当于gapi.client.request()函数?

Short of making the network call directly without use of the library, is there an equivalent for the gapi.client.request() function?

推荐答案

我在使用nodejs和调用Google驱动器API时也寻找类似的选择。我正在使用googleapi。

I was also looking for similar alternative when using nodejs and calling Google drive API. I am using googleapi. Following code snippet might help to give idea on API.

   googleapis
    .discover('drive', 'v2')
    .execute(function(err, client) {
        req = client.drive.files.list()
        console.log(req);
        req.execute(function(err, result) {
            console.log(err);
            console.log(result);
        });
    });

这篇关于在Google Drive API插入/上传中使用node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆