```python import requests import dns.resolver from urllib3.util import connection _orig_create_connection = None def patched_create_connection(address, *args, **kwargs): """Wrap urllib3's create_connection to resolve the name elsewhere""" # resolve hostname to an ip address; use your own # resolver here, as otherwise the system resolver will be used. host, port = address if host == 'spacedock.info': result = dns.resolver.resolve('web1.52k', 'A') hostname = result[0].to_text() global _orig_create_connection return _orig_create_connection((hostname, port), *args, **kwargs) def main(): version = [{"download_path": "content/DasSkelett_29813/test/test-1.4.zip"}] global _orig_create_connection _orig_create_connection = connection.create_connection connection.create_connection = patched_create_connection resp = requests.request('PURGE', f'https://spacedock.info/{version[0].get("download_path")}') print(resp.status_code) connection.create_connection = _orig_create_connection if __name__ == "__main__": main() ```