google-api-js-client - 通过指定 URI、HTTP 方法、标头、内容类型和请求正文来构造您的 HTTP 请求
问题描述
I am trying to authorize gapi for the first time but am very unfamiliar with alot of the information being requested
ALl the sample videos, quick starts and samples
<!DOCTYPE html>
<html>
<head>
<title>Drive API Quickstart</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
我正在尝试运行示例代码来授权 gapi,但无法突破快速入门中描述的元素障碍。添加本地主机后,除了我看到根目录中所有文件夹的超链接菜单外,什么都没有发生~
<p>Drive API Quickstart</p>
<!--Add buttons to initiate auth sequence and sign out-->
<button id="authorize_button" style="display:block;">Authorize</button>
<button id="signout_button" style="display: block;">Sign Out</button>
<pre id="content" style="white-space: pre-wrap;"></pre>
<script type="text/javascript">
// Client ID and API key from the Developer Console
var CLIENT_ID = 'CLIENT ID Obtained from GCP authorizaion after enbling APIS';
var API_KEY = 'API Key obtained';
// Array of API discovery doc URLs for APIs used by the quickstart
var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"];
// Authorization scopes required by the API; multiple scopes can be
// included, separated by spaces.
var SCOPES =
' https://www.googleapis.com/auth/drive.metadata.readonly ';
var authorizeButton = document.getElementById('authorize_button');
var signoutButton = document.getElementById('signout_button');
/**
* On load, called to load the auth2 library and API client library.
*/
function handleClientLoad() {
gapi.load('client:auth2', initClient);
}
/**
* Initializes the API client library and sets up sign-in state
* listeners.
...
<script async defer src="https://apis.google.com/js/api.js" onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
</script>
</body>
</html>
when i get to 3 a. (Load the URL http://localhost:8000 into your browser.) nothing happens although I can see in cmd http 200
解决方案
推荐阅读
- android - 如何在 android 中使用 asp.net 信号器
- android - 从完整的日历日期格式中获取日期名称
- sorting - 在 MIPS 中按地址对值进行排序
- php - 基于两列的排名
- typescript - Typescript 接口/JSON 查询类型
- windows - 在 Windows 上使用 Spring Web 上传文件卡在大文件上
- mysql - 获取具有 Min() 值的记录的 id
- mysql - Mysql问题和使用函数last insert ID
- php - 如何在 Laravel 中扩展 PHPUnit?
- java - spark submit 抛出错误 java.lang.ClassNotFoundException: scala.runtime.java8.JFunction2$mcIII$sp