demo_requests_head_cookies.py:
import requests url = 'https://www.begtut.com/python/demopage.php' #use the 'cookies' parameter to send cookies to the server: x = requests.head(url, cookies = {"favcolor": "Red"}) print(x.status_code)
➜ begtut>python demo_requests_head_cookies.py
200