我正在使用https://developers.google.com/docs/api/quickstart/js中的文档在Windows 64位计算机上使用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拒绝连接。会有人碰巧知道问题是什么吗?谢谢。
答案 0 :(得分:0)
我遇到了同样的问题,这似乎是默认绑定的问题。此问题已在Python3中使用bind参数修复。
python -m http.server 8000 --bind 127.0.0.1