Using the requests library I write a request to proxmox to get information about the state of the containers:

 zapros1 = requests.get('https://192.168.1.107:8006/api2/json/nodes/debprox/lxc', headers=headers, cookies=cookies, verify=False) 

Based on the documentation, as a response I should get an array of information about the containers.

Instead, print (zapros1) gives me 200, and print(type(zapros1)) displays:

 <class 'requests.models.Response'> 

What to do with it? And how to get all the same array with information?

1 answer 1

requests.get() returns an object of type requests.models.Response .

If the site returns a JSON object, then it's best to parse it using the .json() method

 r = requests.get(url) if r.ok: data = r.json()