import urllib.request import json url = 'https://petstore.swagger.io/v2/store/inventory' try: with urllib.request.urlopen(url) as response: body = json.loads(response.read()) headers = response.getheaders() status = response.getcode() print(headers) print(status) print(body) except urllib.error.URLError as e: print(e.reason) >python get.py [('Date', 'Fri, 10 Apr 2020 10:25:52 GMT'), ('Access-Contr
