08-17-2020 10:59 AM
Hi,
When can i run code "get-ap-json.py" this return the message: [Errno 11001] getaddrinfo failed. Why?
This code is:
from urllib.request import Request, urlopen
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
req = Request('https://cmxlocationsandbox.cisco.com/api/config/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone')
req.add_header('Authorization', 'Basic bGVhcm5pbmc6bGVhcm5pbmc=')
response = urlopen(req)
response_string = response.read().decode('utf-8')
print(response_string)
response.close()
Thanks.
08-18-2020 02:17 AM
Hi there,
This error is either called by a DNS or a HTTP proxy issue.
If you are behind a proxy,. make the following changes to your code:
proxy_dict = {"http": <ip_address_of_proxy>:<proxy_port>, "https: <ip_address_of_proxy>:<proxy_port>}
req = Request('https://cmxlocationsandbox.cisco.com/api/config/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone',
proxies=proxy_dict)
cheers,
Seb.
08-18-2020 06:33 AM
Hey there, can you share where or what resource you are following please?
Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide