Improve HTTP handling in scripts (#449)

Provide some helper methods to hide the complexity of parsing HTML, JSON, YAML, XML or Markdown.
This commit is contained in:
Marc Wrobel
2025-06-28 11:46:04 +02:00
parent fda4967c38
commit 312ce078bb
43 changed files with 103 additions and 137 deletions

View File

@@ -22,7 +22,7 @@ for config in endoflife.list_configs_from_argv():
name = urllib.parse.quote(config.url)
mapping = Mapping(config.data["fields"])
data = http.fetch_url('https://access.redhat.com/product-life-cycles/api/v1/products?name=' + name).json()
data = http.fetch_json('https://access.redhat.com/product-life-cycles/api/v1/products?name=' + name)
for version in data["data"][0]["versions"]:
version_name = version["name"]