[英]“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.