简体   繁体   English

请求 - Python - 无法建立新连接:[Errno 111] 连接被拒绝

[英]Requests - Python - Failed to establish a new connection: [Errno 111] Connection refused

I have a server running in Ubuntu OS, and I am using Python for getting to learn.我有一台在 Ubuntu 操作系统中运行的服务器,我正在使用 Python 来学习。

I started an app which I installed, When I opened the app in browser the page is not secure, like this -我启动了一个我安装的应用程序,当我在浏览器中打开应用程序时,页面不安全,就像这样 -

你的图片描述在这里

I am getting some data from this page using python -我正在使用 python 从这个页面获取一些数据 -

from urllib3.exceptions import InsecureRequestWarning
import requests
requests.urllib3.disable_warnings(category=InsecureRequestWarning)
req = requests.get(url='https://127.0.0.1:7001', verify=False)

This shows an error -这显示了一个错误 -

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=7001): Max retries exceeded with url: / (Caused by 
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc2ae5f94f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

When I print the variable req to check the status, but python shows the variable is not defined当我打印变量req以检查状态时,但 python 显示变量未定义

How to solve this, thanks这个怎么解决,谢谢

HTTPSConnectionPool(host='127.0.0.1', port=443) HTTPSConnectionPool(host='127.0.0.1', port=443)

443 is the default port for HTTPS. 443 是 HTTPS 的默认端口。

You're probably (we can't see how you've defined url , but that's my best guess) trying https://127.0.0.1/... , not https://127.0.0.1:7001/... – fix that in your code.您可能(我们看不到您如何定义url ,但这是我最好的猜测)尝试https://127.0.0.1/... ,而不是https://127.0.0.1:7001/... – 在您的代码中修复它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Docker - Elasticsearch - 无法建立新连接:[Errno 111] Connection refused',)) - Docker - Elasticsearch - Failed to establish a new connection: [Errno 111] Connection refused',)) Docker build pytest:无法建立新连接:[Errno 111]连接被拒绝 - Docker build pytest :Failed to establish a new connection: [Errno 111] Connection refused 最大重试次数超过 url:无法建立新连接:[Errno 111] 连接被拒绝' - Max retries exceeded with url: Failed to establish a new connection: [Errno 111] Connection refused' 连接错误(&#39;<urllib3.connection.HTTPSConnection object at 0x7f3a5d760390> : 建立新连接失败: [Errno 111] 连接被拒绝&#39;) - ConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f3a5d760390>: Failed to establish a new connection: [Errno 111] Connection refused') urllib3 - 无法建立新连接:[Errno 111] - urllib3 - Failed to establish a new connection: [Errno 111] 新连接错误(<urllib3.connection.HTTPConnection object at 0x7f09b9f0a7c0> : 建立新连接失败: [Errno 111] 连接被拒绝) - NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f09b9f0a7c0>: Failed to establish a new connection: [Errno 111] Connection refused) 错误 111:仅在 python IDLE 中拒绝连接 - Errno 111: Connection refused only in python IDLE Python错误:[Errno 111]连接被拒绝 - Python error: [Errno 111] Connection refused Errno 111连接在Python套接字编程中被拒绝 - Errno 111 Connection refused in Python sockets programming errno 111连接被ubuntu vmware中的python拒绝 - errno 111 connection refused with python in ubuntu vmware
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM