demo_requests_post_url.py:
import requests url = 'https://www.begtut.com/python/demopage.php' x = requests.post(url) #print the response text (the content of the requested file): print(x.text)
➜ begtut>python demo_requests_post_url.py
<!DOCTYPE html>
<html>
<body>
<h1>This is a Test Page</h1>
</body>
</html>