The data parameter of urlopen is used to set the body of the request. GET requests cannot contain a body, as they should only be used to return a resource, which should only be defined by it's URL.
If you need to pass parameters, you can append them to the url, in your case :
from urllib.request import urlopen
urlopen('http://localhost:8082/v3/nodes?{}'.format(query))
Answer from ploutch on Stack OverflowVideos
The data parameter of urlopen is used to set the body of the request. GET requests cannot contain a body, as they should only be used to return a resource, which should only be defined by it's URL.
If you need to pass parameters, you can append them to the url, in your case :
from urllib.request import urlopen
urlopen('http://localhost:8082/v3/nodes?{}'.format(query))
The data parameter is for POST only and you cannot send a body in a GET request, so if you want to specify parameters you have to pass them through the URL.
One easy way to build such an URL is through the help of urllib.urlencode. Take a look at the documentation for this function.
Use the former one:
I will add the source of why it's better.
Anyways you need to set verify as False to prevent requests from verifying SSL certificates for HTTPS requests:
import requests
r = requests.get("https://example.com", verify=False)
Edit:
Difference between requests.get() and urllib.request.urlopen() python
What are the differences between the urllib, urllib2, and requests module?
This is happening because example.com does not have a valid certificate. So requests warns you that the https connection won't be trusted. If you trust the server then you should do what wolframalpha suggested.