Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
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)
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.w3schools.com/python/demopoage.php">here</a></body>