Apr-18-2018, 10:48 PM
(Apr-18-2018, 08:21 PM)gentoobob Wrote: I just found some examples with urllib3 and it seems to run a bit better and looks as if I need to do some kind of decoding.Requests is powered bye urllib3,so has those features and more.
Here is the corrected version,this is Python 3.6 as it has
f-string
.For Python version before that use
.format()
import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) user = 'foo' password = 'bar' page = 1 url = f"https://{user}:{password}@10.10.10.1/vmrest/users?rowsPerPage=2000&pageNumber={page}" response = requests.get(url, verify=False) xml = response.content print(xml)