我正在创建一个新的 AWS 机器人,它必须连接到安装在我本地机器上的 Apache Tomcat 服务器上的应用程序。我可以使用 URL ' https://localhost:8080/iii ' 向邮递员发出请求。但是,如果我使用 python 3.7 和 requests 函数在我的 lambda 代码中给出相同的 URL,则会引发以下错误:
[错误] ConnectionError: ('Connection aborted.', OSError(97, 'Address family not supported by protocol'))
日志是:
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 64, in lambda_handler
request_status = request_ent(idenName_input,AppName_input,EntName_input,OpName_input)
File "/var/task/lambda_function.py", line 47, in request_entitlement
r = requests.post(url, json.dumps(data),auth=('username', 'password'))
File "/var/runtime/botocore/vendored/requests/api.py", line 109, in post
return request('post', url, data=data, json=json, **kwargs)
File "/var/runtime/botocore/vendored/requests/api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "/var/runtime/botocore/vendored/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/var/runtime/botocore/vendored/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/var/runtime/botocore/vendored/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
END RequestId: 0c190f74-9cd0-49f7-bb6c-be0a98805e83