Google Cloud Print API:需要用户凭证 [英] Google Cloud Print API: User credentials required

查看:82
本文介绍了Google Cloud Print API:需要用户凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google云打印库来获取可供用户使用的云打印机列表,但是当我发出请求时,我收到一个错误消息:需要用户凭据"

I'm trying to use the Google Cloud Print library to get a list of the cloud printers available to the users, but when I do a request I get an error: "User credentials required"

这是我发送请求的方式:

This is how I send the request:

var request = require('request');

var options = {
    url: 'https://www.google.com/cloudprint/search',
    headers: {
            'X-CloudPrint-Proxy': 'APP_NAME',
            'Authorization': 'GoogleLogin auth=ACCESS_TOKEN_HERE'
    }
};

function callback(err, response, body) {
    console.log(err);
    console.log(response);
    console.log(body);
}

request(options, callback);

推荐答案

为了使这项工作有效(因为没有确切的文档).

In order to make this work (as there is no exact documentation).

https://www.googleapis.com/auth/cloudprint 添加到登录过程.

这篇关于Google Cloud Print API:需要用户凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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