google doc api-拒绝连接的本地主机

问题描述 投票:0回答:1

我在Windows 64位计算机上,遵循https://developers.google.com/docs/api/quickstart/js中的文档以使用google docs api。按照说明,我已经下载并安装了python 3.8(来自https://www.python.org/downloads/),并设置了index.html文件,其中替换了客户端ID和API密钥占位符。在Visual Studio代码终端中运行命令python -m http.server 8000并在浏览器中打开http://localhost:8000后,它说无法访问该站点,并且localhost拒绝连接。有人碰巧知道问题是什么吗?谢谢。

编辑:终端的屏幕截图enter image description here

google-api localhost google-docs google-docs-api google-developers-console
1个回答
0
投票

我有相同的问题,它似乎是默认绑定的问题。此问题已在Python3中使用bind参数修复。

python -m http.server 8000 --bind 127.0.0.1
© www.soinside.com 2019 - 2024. All rights reserved.