With verify = False in the url I get this error: requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?
When I leave it out of the url I get this error: SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
In both cases verify = False is in response = requests.request.
Here is the code:
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import json
from requests.auth import HTTPBasicAuth
src = input('Source > ')
dst = input('Destination > ')
svc = input('port > ')
url = requests.get('https://192.168.1.1/securetrack/api/topology/path', auth=HTTPBasicAuth('admin', 'p@ss'))
querystring = {"src":src,"dst":dst,"service": svc}
headers = {
'Accept': "application/json",
}
response = requests.request("GET", url, headers=headers, params=querystring, verify=False)
print(response.text)
urlis not a URL but a response object. - Klaus D.