import requests
url = 'https://w3schools.com/python/demopage.php'
#Sometimes the server redirects a request, could be if the file does not exist etc., set the 'allow_redirects' parameter to False to deny redirects:
x = requests.delete(url, allow_redirects=False)
#print the response text (the content of the requested file):
print(x.text)