I want to make a GET
request for a given URL, but I want to send cookie data as a web browser does.
For example, in the code below:
from urllib import request
req = request.Request('http://servidor/pagina.html')
response = request.urlopen(req)
print(response.read().decode())
If I print the headers, the result is an empty list:
print(req.header_items())
But I want to send a header HTTP
like this:
Cookie: atributo=valor+do+atributo
Part of the question for anyone who is already experienced with Python:
I am in the Level 17 of pythonchallenge.com and I need to make a request by sending an "info" cookie. with the value "the + flowers + are + on + their + way" to link .