简体   繁体   English

尝试POST时出现“ getaddr信息失败”错误

[英]“getaddr info failed” Error When Attempting POST

I am using urllib and httplib to do an HTTPS POST to a web page, using a PEM cert file and key fileWhen I ran it I got the following error: "I/O error (10109): getaddrinfo failed" 我正在使用urllib和httplib使用PEM证书文件和密钥文件对网页进行HTTPS POST运行时,出现以下错误:“ I / O错误(10109):getaddrinfo失败”

It is obvious I am getting the error trying to do the POST request. 显然我在尝试执行POST请求时遇到错误。 How do I eliminate this error? 如何消除此错误?

You've used an incorrect syntax for the hostname and port number. 您使用的主机名和端口号语法不正确。 Instead of: 代替:

HTTPSConnection("avaa2.example.mil:443", ...)

Try this: 尝试这个:

HTTPSConnection("avaa2.example.mil", 443, ...)

Reference: https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection 参考: https : //docs.python.org/2/library/httplib.html#httplib.HTTPSConnection

暂无
暂无

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

相关问题 尝试使用 createview 保存时出现 NOT NULL 约束失败错误 - NOT NULL constraint failed error when attempting to save using createview 尝试插入信息时sqlite3错误,提供的绑定数不正确 - sqlite3 error when attempting to insert info, incorrect number of bindings supplied 尝试将文件上传到 Sharepoint 时收到“ShareplumRequestError: Sharepoint HTTP Post/Get Failed” - Recieving 'ShareplumRequestError: Sharepoint HTTP Post/Get Failed' When Attempting to Upload Files to Sharepoint 当 twitter 发布时,尝试向 discord 发布消息时出错 - Error-ing out attempting to post a message to discord when a twitter post is made 尝试发布到gfycat.com时,Python请求提供错误信息(“连接已中止。”,错误(“(104,'ECONNRESET')”,))) - Python requests giving error ('Connection aborted.', error(“(104, 'ECONNRESET')”,)) when attempting to post to gfycat.com 消息:错误:轮询更改失败:在通过 Selenium 和 FirefoxProfile 下载文件时尝试获取资源时出现网络错误 - Message: Error: Polling for changes failed: NetworkError when attempting to fetch resource while downloading file through Selenium and FirefoxProfile 尝试向 API - Django 发出 POST 请求时出现属性错误 - I am getting an Attribute Error when attempting POST request to API - Django 如何修复“无法加载本机 TensorFlow 运行时”。 尝试在 gpu 上运行时出错? - How to fix "Failed to load the native TensorFlow runtime." error when attempting running on gpu? 安装Shapely时,“ python setup.py egg_info”失败,错误代码为1 - “python setup.py egg_info” failed with error code 1 when installing Shapely 通过pip安装时,获取命令“ python setup.py egg_info”失败,错误代码为1 - Getting Command “python setup.py egg_info” failed with error code 1 when installing via pip
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM