import requests
url = 'https://w3schools.com/python/demopage.asp'
#use the 'headers' parameter to set the HTTP headers:
x = requests.get(url, headers = {"HTTP_HOST": "MyVeryOwnHost"})
print(x.text)
#the 'demopage.asp' prints all HTTP Headers